Uses PHP's hashing functions to create a hash of the string provided, using the options
specified. The default hash algorithm is SHA-512.
public static hash ( string $string, array $options = [] ) : string | ||
$string | string | The string to hash. |
$options | array | Supported options: - `'type'` _string_: Any valid hashing algorithm. See the `hash_algos()` function to determine which are available on your system. - `'salt'` _string_: A _salt_ value which, if specified, will be prepended to the string. - `'key'` _string_: If specified `hash_hmac()` will be used to hash the string, instead of `hash()`, with `'key'` being used as the message key. - `'raw'` _boolean_: If `true`, outputs the raw binary result of the hash operation. Defaults to `false`. |
return | string | Returns a hashed string. |