HMAC.js计算HMAC-SHA1、HMAC-MD5。

如何使用:

浏览器:


<script src='\"lib/HMAC.js\"'></script>

<script>

console.log(HMAC(\"MD5\", \"\")); // \"74e6f7298a9c2d168935f58c001bad88\"

</script>

网络工作者:


importScripts(\"lib/HMAC.js\");

console.log(HMAC(\"MD5\", \"\")); // \"74e6f7298a9c2d168935f58c001bad88\"

Node.js:


var HMAC = require(\"lib/HMAC.js\");

console.log(HMAC(\"MD5\", \"\")); // \"74e6f7298a9c2d168935f58c001bad88\"