We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The method is:
/** * Generates an HMAC-SHA1 signature. */ private function hmacsha1(string $key, string $message): string { if (function_exists('hash_hmac')) { return hash_hmac('sha1', $message, $key, true); } $blocksize = 64; if (strlen($key) > $blocksize) { $key = pack('H*', sha1($key)); } $key = str_pad($key, $blocksize, chr(0x00)); $ipad = str_repeat(chr(0x36), $blocksize); $opad = str_repeat(chr(0x5C), $blocksize); $hmac = pack('H*', sha1(($key ^ $opad).pack('H*', sha1(($key ^ $ipad).$message)))); return $hmac; }
IMO https://www.php.net/manual/en/function.hash-hmac.php exists in CI, and so it is used, and the subsequent code that has a "manual" implementation of hash_hmac never gets run during the unit tests.
hash_hmac
https://www.php.net/manual/en/hash.installation.php
"As of PHP 7.4.0, the Hash extension is a core PHP extension, so it is always enabled."
So, IMO, we can remove the function_exists check, and the "manual" implementation, and just directly call hash_hmac
function_exists
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The method is:
IMO https://www.php.net/manual/en/function.hash-hmac.php exists in CI, and so it is used, and the subsequent code that has a "manual" implementation of
hash_hmac
never gets run during the unit tests.https://www.php.net/manual/en/hash.installation.php
"As of PHP 7.4.0, the Hash extension is a core PHP extension, so it is always enabled."
So, IMO, we can remove the
function_exists
check, and the "manual" implementation, and just directly callhash_hmac
The text was updated successfully, but these errors were encountered: