Passwords
class Passwords
Password Hashing.
Methods
__construct(string $algo = PASSWORD_DEFAULT, array $options = [])
Chooses which secure algorithm is used for hashing and how to configure it.
string
hash(string $password)
Computes password´s hash. The result contains the algorithm ID and its settings, cryptographical salt and the hash itself.
bool
verify(string $password, string $hash)
Finds out, whether the given password matches the given hash.
bool
needsRehash(string $hash)
Finds out if the hash matches the options given in constructor.
Details
at line 24
__construct(string $algo = PASSWORD_DEFAULT, array $options = [])
Chooses which secure algorithm is used for hashing and how to configure it.
at line 34
string
hash(string $password)
Computes password´s hash. The result contains the algorithm ID and its settings, cryptographical salt and the hash itself.
at line 55
bool
verify(string $password, string $hash)
Finds out, whether the given password matches the given hash.
at line 68
bool
needsRehash(string $hash)
Finds out if the hash matches the options given in constructor.