Skip to content

Instantly share code, notes, and snippets.

@astur
Created April 11, 2016 23:04
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 astur/7f9b3e75cb0da951a017a22b291819f9 to your computer and use it in GitHub Desktop.
Save astur/7f9b3e75cb0da951a017a22b291819f9 to your computer and use it in GitHub Desktop.
Easy sha256-for-object module
var crypto = require('crypto');
module.exports = function (obj){
var str = JSON.stringify(obj);
return crypto.createHash('sha256').update(str).digest('base64');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment