$algorithm
$algorithm : integer|null
This class provides hashing functions while abstracting the algorithm.
Note: This class uses OpenSSL for strong encryption
__construct(string $algorithm = \Gishiki\Security\Hashing\Algorithm::BCRYPT)
Create an object that provides an easy and unique interface to use any of the supported algorithms
string | $algorithm | the algorithm to be used |
the given algorithm is unsupported
hash(string $message) : string
Generate the hash of the given message using the chosen algorithm
string | $message | the message to be hashed |
the message or the message digest is given as a non-string or an empty string
the error occurred while generating the hash for the given message
the result of the hashing algorithm
verify(string $message, string $digest) : boolean
Check the hash of the given message using the chosen algorithm
string | $message | the message to be checked against the digest |
string | $digest | the message digest to be checked |
the message or the message digest is given as a non-string or an empty string
the error occurred while generating the hash for the given message
the result of the check: true on success, false otherwise