Hasher
abstract class Hasher implements HasherInterface
Base hasher.
Properties
protected array | $options | Algorithm options. |
Methods
__construct(array $options = [])
Constructor.
array
normalizeOptions(array $options)
Normalizes the algorithm options.
int|string
getAlgorithm()
Returns the algorithm type.
string
create(string $password)
Creates a password hash.
bool
verify(string $password, string $hash)
Verifies that the password matches the hash.
bool
needsRehash(string $hash)
Returns TRUE if the password needs rehashing and FALSE if not.
Details
at line 31
__construct(array $options = [])
Constructor.
at line 42
protected array
normalizeOptions(array $options)
Normalizes the algorithm options.
at line 52
abstract protected int|string
getAlgorithm()
Returns the algorithm type.
at line 57
string
create(string $password)
Creates a password hash.
at line 72
bool
verify(string $password, string $hash)
Verifies that the password matches the hash.
at line 80
bool
needsRehash(string $hash)
Returns TRUE if the password needs rehashing and FALSE if not.