BcryptHasher
class BcryptHasher extends AbstractHasher implements Hasher
Properties
| protected int | $rounds | The default cost factor. |
|
| protected bool | $verifyAlgorithm | Indicates whether to perform an algorithm check. |
|
| protected int|null | $limit | The maximum allowed length of strings that can be hashed. |
Methods
Check the given plain value against a hash.
Determine whether a hash value is present.
Create a new hasher instance.
Hash the given value.
Check if the given hash has been hashed using the given options.
Verifies that the configuration is less than or equal to what is configured.
Verify the hashed value's algorithm.
Verify the hashed value's options.
Set the default password work factor.
Extract the cost value from the options array.
Details
in
AbstractHasher at line 14
array
info(string $hashedValue)
Get information about the given hashed value.
at line 72
bool
check(string $value, string|null $hashedValue, array $options = [])
Check the given plain value against a hash.
in
AbstractHasher at line 34
protected bool
hasHash(string|null $hashedValue)
Determine whether a hash value is present.
at line 34
__construct(array $options = [])
Create a new hasher instance.
at line 50
string
make(string $value, array $options = [])
Hash the given value.
at line 88
bool
needsRehash(string|null $hashedValue, array $options = [])
Check if the given hash has been hashed using the given options.
at line 104
bool
verifyConfiguration(string $hashedValue)
| internal |
Verifies that the configuration is less than or equal to what is configured.
at line 112
protected bool
isUsingCorrectAlgorithm(string $hashedValue)
Verify the hashed value's algorithm.
at line 120
protected bool
isUsingValidOptions(string $hashedValue)
Verify the hashed value's options.
at line 143
BcryptHasher
setRounds(int $rounds)
Set the default password work factor.
Mutates the shared hasher instance held by the HashManager; per-request use races across coroutines.
at line 154
protected int
cost(array $options = [])
Extract the cost value from the options array.