I need a node.js equivalent of the following Ruby code:
require 'openssl'
digest = OpenSSL::Digest::Digest.new('sha1')
signature = OpenSSL::HMAC.hexdigest(digest, 'auth secret', 'some string')
I tried the following in node.js, but the Ruby signature is different from node's
var crypto, signature;
crypto = require('crypto');
signature = crypto.createHash("sha1").update('auth secret').update('some string').digest("hex");