How can I get HMAC-SHA512(key, data) in the browser using Crypto Web API (window.crypto
)?
Currently I am using CryptoJS library and it is pretty simple:
CryptoJS.HmacSHA512("myawesomedata", "mysecretkey").toString();
Result is 91c14b8d3bcd48be0488bfb8d96d52db6e5f07e5fc677ced2c12916dc87580961f422f9543c786eebfb5797bc3febf796b929efac5c83b4ec69228927f21a03a
.
I want to get rid of extra dependencies and start using Crypto Web API instead. How can I get the same result with it?