Passwords
class Passwords
Password hashing and verification.
Methods
__construct(string $algo = PASSWORD_DEFAULT, array $options = [])
Configures the hashing algorithm and its options.
string
hash(string $password)
Computes a password hash containing the algorithm ID, settings, salt, and the hash itself.
bool
verify(string $password, string $hash)
Checks whether the password matches the given hash.
bool
needsRehash(string $hash)
Checks whether the hash needs to be rehashed with the current algorithm and options.
Details
at line 21
__construct(string $algo = PASSWORD_DEFAULT, array $options = [])
Configures the hashing algorithm and its options.
at line 32
string
hash(string $password)
Computes a password hash containing the algorithm ID, settings, salt, and the hash itself.
at line 53
bool
verify(string $password, string $hash)
Checks whether the password matches the given hash.
at line 66
bool
needsRehash(string $hash)
Checks whether the hash needs to be rehashed with the current algorithm and options.