Skip to content

Instantly share code, notes, and snippets.

@alexey-sh
Forked from nolim1t/sign.js
Created August 14, 2019 21:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexey-sh/73fc63b6bf2427cc6e890a79766976e4 to your computer and use it in GitHub Desktop.
Save alexey-sh/73fc63b6bf2427cc6e890a79766976e4 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