PlaintextPasswordHasher
in package
implements
LegacyPasswordHasherInterface
Uses
CheckPasswordLengthTrait
PlaintextPasswordHasher does not do any hashing but is useful in testing environments.
As this hasher is not cryptographically secure, usage of it in production environments is discouraged.
Tags
Table of Contents
Interfaces
- LegacyPasswordHasherInterface
- Provides password hashing and verification capabilities for "legacy" hashers that require external salts.
Properties
- $ignorePasswordCase : bool
Methods
- __construct() : mixed
- hash() : string
- Hashes a plain password.
- needsRehash() : bool
- verify() : bool
- Checks that a plain password and a salt match a password hash.
- isPasswordTooLong() : bool
- mergePasswordAndSalt() : string
Properties
$ignorePasswordCase
private
bool
$ignorePasswordCase
Methods
__construct()
public
__construct([bool $ignorePasswordCase = false ]) : mixed
Parameters
- $ignorePasswordCase : bool = false
-
Compare password case-insensitive
hash()
Hashes a plain password.
public
hash(string $plainPassword[, string $salt = null ]) : string
Parameters
- $plainPassword : string
- $salt : string = null
Return values
stringneedsRehash()
public
needsRehash(string $hashedPassword) : bool
Parameters
- $hashedPassword : string
Return values
boolverify()
Checks that a plain password and a salt match a password hash.
public
verify(string $hashedPassword, string $plainPassword[, string $salt = null ]) : bool
Parameters
- $hashedPassword : string
- $plainPassword : string
- $salt : string = null
Return values
boolisPasswordTooLong()
private
isPasswordTooLong(string $password) : bool
Parameters
- $password : string
Return values
boolmergePasswordAndSalt()
private
mergePasswordAndSalt(string $password, string|null $salt) : string
Parameters
- $password : string
- $salt : string|null