title: HMAC SHA256 hex digest in javascript
body: <p>I'm trying to write a javascript lib to push events to Pusher.</p>
  
  <p>In the environment I'm using I can't use nodejs, so no require('crypto') ... or at least I do not know of a way of using it outside node.</p>
  
  <p>I'm following the example guide here: <a href="http://pusher.com/docs/rest_api" rel="nofollow">http://pusher.com/docs/rest_api</a>; I'm stuck in the part 
  where it says I should generate the HMAC SHA256 hex digest.</p>
  
  <p>I am using this library <a href="http://code.google.com/p/crypto-js/#HMAC" rel="nofollow">http://code.google.com/p/crypto-js/#HMAC</a></p>
  
  <p>So, following the instructions on Pusher i wrote</p>
  
  <pre><code>CryptoJS.HmacSHA256(
    'POST\n/apps/3/channels/project-3/events\nauth_key=278d425bdf160c739803&amp;auth_timestamp=1272044395&amp;auth_version=1.0&amp;body_md5=7b3d404f5cde4a0b9b8fb4789a0098cb&amp;name=foo',
    '7ad3773142a6692b25b8'
  );
  </code></pre>
  
  <p>But that's giving me <code>20b132baa2aaf44ea1fab814f0788aaa44eed23a2d252c72e4dc2aaea0d6ac24</code> instead of <code>b3152b2bb5a5b0bae66435a498797aa763e9b74f86cc97c9175424f8308b2f80</code>.</p>
  
  <p>What is bothering me is that I didn't do the "hex digest" part, so maybe that's what I'm missing, but I couldn't find a suitable lib to do this in javascript.
  Do you spot any errors in what I did? Do you have a library to suggest?</p>
  
  <p>Thanks in advance for any help.</p>