开发者

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's


Just 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜