hash_hmac()WP 3.2.0

Compat function to mimic hash_hmac().

The Hash extension is bundled with PHP by default since PHP 5.1.2. However, the extension may be explicitly disabled on select servers. As of PHP 7.4.0, the Hash extension is a core PHP extension and can no longer be disabled. I.e. when PHP 7.4.0 becomes the minimum requirement, this polyfill and the associated _hash_hmac() function can be safely removed.

Хуков нет.


Строку|false. The hash in output determined by $binary. False if $algo is unknown or invalid.


hash_hmac( $algo, $data, $key, $binary );
$algo(строка) (обязательный)
Hash algorithm. Accepts 'md5' or 'sha1'.
$data(строка) (обязательный)
Data to be hashed.
$key(строка) (обязательный)
Secret key to use for generating the hash.
Whether to output raw binary data (true), or lowercase hexits (false).
По умолчанию: false


Список изменений

С версии 3.2.0 Введена.

Код hash_hmac() WP 6.5.5

function hash_hmac( $algo, $data, $key, $binary = false ) {
	return _hash_hmac( $algo, $data, $key, $binary );