Skip to content

Instantly share code, notes, and snippets.

@Qard
Created August 12, 2015 22:25
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 Qard/0ffc057d3335e6c72acd to your computer and use it in GitHub Desktop.
Save Qard/0ffc057d3335e6c72acd to your computer and use it in GitHub Desktop.
var algorithm = crypto.getHashes()[0]
var hash = crypto.createHash(algorithm) // crypto entry
hash.update('foo')
fs.readFile(__filename, function (err, data) {
hash.update('bar')
var hashed = hash.digest() // crypto exit
done()
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment