I'm trying to write a javascript lib to push events to Pusher.
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.
I'm following the example guide here: http://pusher.com/docs/rest_api; I'm stuck in the part where it says I should generate the HMAC SHA256 hex digest.
I am using this library http://code.google.com/p/crypto-js/#HMAC
So, following the instructions on Pusher i wrote
CryptoJS.HmacSHA256(
'POST\n/apps/3/channels/project-3/events\nauth_key=278d425bdf160c739803&auth_timestamp=1272044395&auth_version=1.0&body_md5=7b3d404f5cde4a0b9b8fb4789a0098cb&name=foo',
'7ad3773142a6692b25b8'
);
But that's giving me 20b132baa2aaf44ea1fab814f0788aaa44eed23a2d252c72e4dc2aaea0d6ac24
instead of b3152b2bb5a5b0bae66435a498797aa763e9b74f86cc97c9175424f8308b2f80
.
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?
Thanks in advance for any help.