BCrypt
in package
implements
Hasher
Class BCrypt
Implements the Hasher interface using the BCrypt algorithm for secure password hashing.
Provides methods to hash passwords and verify hashed passwords using the BCrypt algorithm.
Table of Contents
Interfaces
- Hasher
- Interface Hasher
Methods
- hash() : string
- Generates a hash value from the given data string.
- verify() : bool
- Verifies that the given data matches the provided hash.
Methods
hash()
Generates a hash value from the given data string.
public
hash(string $data) : string
Parameters
- $data : string
-
The input data to be hashed.
Tags
Return values
string —The resulting hash as a string.
verify()
Verifies that the given data matches the provided hash.
public
verify(string $data, string $hash) : bool
Parameters
- $data : string
-
The original data to verify.
- $hash : string
-
The hash to compare against.
Tags
Return values
bool —Returns true if the data matches the hash, false otherwise.