Created
April 11, 2016 23:04
-
-
Save astur/7f9b3e75cb0da951a017a22b291819f9 to your computer and use it in GitHub Desktop.
Easy sha256-for-object module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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