Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
var crypto = require('crypto');
// change to 'md5' if you want an MD5 hash
var hash = crypto.createHash('sha1');
// change to 'binary' if you want a binary hash.
// the text that you want to hash
hash.write('hello world');
// very important! You cannot read from the stream until you haven't called end()
// and now you get the resulting hash
var sha1sum =;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.