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 71
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 33
__construct(array $options = [])
Create a new hasher instance.
at line 49
string
make(string $value, array $options = [])
Hash the given value.
at line 87
bool
needsRehash(string|null $hashedValue, array $options = [])
Check if the given hash has been hashed using the given options.
at line 103
bool
verifyConfiguration(string $hashedValue)
| internal |
Verifies that the configuration is less than or equal to what is configured.
at line 111
protected bool
isUsingCorrectAlgorithm(string $hashedValue)
Verify the hashed value's algorithm.
at line 119
protected bool
isUsingValidOptions(string $hashedValue)
Verify the hashed value's options.
at line 142
BcryptHasher
setRounds(int $rounds)
Set the default password work factor.
Boot-only. Mutates the shared hasher instance held by the HashManager; per-request use races across coroutines.
at line 152
protected int
cost(array $options = [])
Extract the cost value from the options array.