Skip to content

Instantly share code, notes, and snippets.

@saveroo
Forked from nolim1t/sign.js
Created November 21, 2017 15:21
Show Gist options
  • Save saveroo/5c65719999149eef338d2614a0725a68 to your computer and use it in GitHub Desktop.
Save saveroo/5c65719999149eef338d2614a0725a68 to your computer and use it in GitHub Desktop.
node.js HMAC SHA512 signing
var crypto = require("crypto");
function encrypt(key, str) {
var hmac = crypto.createHmac("sha512", key);
var signed = hmac.update(new Buffer(str, 'utf-8')).digest("base64");
return signed
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment