Function __global->hash_hmac
Definitions
sources_custom/phpstub.php
- Generate a keyed hash value using the HMAC method.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: string
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $algo | string | No | No | required parameter | N/A | N/A | Name of the algorithm to use |
| $data | string | No | No | required parameter | N/A | N/A | The data to hash |
| $key | string | No | No | required parameter | N/A | N/A | The shared secret key |
| $binary | boolean | No | No | False | N/A | N/A | Whether to output as raw binary data (false: output lowercase hex) |
Returns
- The hash
- Type: string
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Generate a keyed hash value using the HMAC method.
*
* @param string $algo Name of the algorithm to use
* @param string $data The data to hash
* @param string $key The shared secret key
* @param boolean $binary Whether to output as raw binary data (false: output lowercase hex)
* @return string The hash
*/
function hash_hmac(string $algo, string $data, string $key, bool $binary = false) : string
* Generate a keyed hash value using the HMAC method.
*
* @param string $algo Name of the algorithm to use
* @param string $data The data to hash
* @param string $key The shared secret key
* @param boolean $binary Whether to output as raw binary data (false: output lowercase hex)
* @return string The hash
*/
function hash_hmac(string $algo, string $data, string $key, bool $binary = false) : string

