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