Interface PasswordHasherInterface
PasswordHasherInterface
Method Summary
-
check() public
Check hash. Generate hash from user provided password string or data array and check against existing hash.
-
hash() public
Generates password hash.
-
needsRehash() public
Returns true if the password need to be rehashed, due to the password being created with anything else than the passwords generated by this class.
Method Detail
check() ¶ public
check(string|array $password, string $hashedPassword): bool
Check hash. Generate hash from user provided password string or data array and check against existing hash.
Parameters
-
string|array
$password Plain text password to hash or data array.
-
string
$hashedPassword Existing hashed password.
Returns
bool
hash() ¶ public
hash(string|array $password): string
Generates password hash.
Parameters
-
string|array
$password Plain text password to hash or array of data required to generate password hash.
Returns
string
needsRehash() ¶ public
needsRehash(string $password): bool
Returns true if the password need to be rehashed, due to the password being created with anything else than the passwords generated by this class.
Returns true by default since the only implementation users should rely on is the one provided by default in php 5.5+ or any compatible library
Parameters
-
string
$password The password to verify
Returns
bool