Arthur Kharkivskiy
Arthur Kharkivskiy

Reputation: 540

CryptoJS.HmacSHA512 returns undefined

<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

But why hash is undefined?

Upvotes: 0

Views: 4433

Answers (1)

Alex K.
Alex K.

Reputation: 175896

The message must be passed as a string;

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

(Assuming stub11111 is a variable, otherwise quote it)

Upvotes: 1

Related Questions