CryptoJS.HmacSHA512返回undefined

时间:2015-06-17 10:42:43

标签: javascript cryptography hmac cryptojs

<script type="text/javascript" src="../js/lib/hmac-sha512.js"></script>
var hash = CryptoJS.HmacSHA512('1111111', 'stub11111');

CryptoJS v3.1.2 code.google.com/p/crypto-js

但为什么哈希未定义?

1 个答案:

答案 0 :(得分:0)

消息必须以字符串形式传递;

var hash = CryptoJS.HmacSHA512("1111111", stub11111);

(假设stub11111是变量,否则引用它)

相关问题