Hasher
in
Interface Hasher
Defines methods for hashing data and verifying hashes.
Table of Contents
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.
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.
Return values
bool —Returns true if the data matches the hash, false otherwise.