- Модуль: clouds
- Путь к файлу: ~/bitrix/modules/clouds/classes/general/security_service_s3.php
- Класс: CCloudSecurityService_AmazonS3
- Вызов: CCloudSecurityService_AmazonS3::hmacsha1
function hmacsha1($data, $key)
{
if(mb_strlen($key) > 64)
$key=pack('H*', sha1($key));
$key = str_pad($key, 64, chr(0x00));
$ipad = str_repeat(chr(0x36), 64);
$opad = str_repeat(chr(0x5c), 64);
$hmac = pack('H*', sha1(($key^$opad).pack('H*', sha1(($key^$ipad).$data))));
return $hmac;
}