Function for those, who really need to use crc32 algorithm in PHP>7.1
<?php
function hash_hmac_crc32(string $key, string $data): string
{
$b = 4;
if (strlen($key) > $b) {
$key = pack("H*", hash('crc32', $key));
}
$key = str_pad($key, $b, chr(0x00));
$ipad = str_pad('', $b, chr(0x36));
$opad = str_pad('', $b, chr(0x5c));
$k_ipad = $key ^ $ipad;
$k_opad = $key ^ $opad;
return hash('crc32', $k_opad . hash('crc32', $k_ipad . $data, true));
}
?>