the best implementation of RFC 2104 HMAC-SHA1
What is the best implementation of RFC 2104 HMAC-SHA1 alg. in php? I have read http://us2.php.net/man开发者_开发问答ual/en/function.hash-hmac.php but when I try them I get
different results. Thank'sJust use the function you linked.
hash_hmac("sha1", $message, $key);
$message and $key are the strings provided by you.
The hash extension is definitely the best option you have in PHP. hash()
and specifically hash_hmac()
as you pointed out are both supporting SHA1 and both do a good job of it.
精彩评论