Skip to content

Instantly share code, notes, and snippets.

@dshaw
Created February 24, 2013 05:28
Show Gist options
  • Save dshaw/5022744 to your computer and use it in GitHub Desktop.
Save dshaw/5022744 to your computer and use it in GitHub Desktop.
shasum with sha1 in node v0.9+
var hash = require('crypto').createHash('sha1')
hash.setEncoding('hex')
process.stdin.pipe(hash).pipe(process.stdout)
@dshaw
Copy link
Author

dshaw commented Feb 24, 2013

Usage:

$ echo -n dshaw | node shasum.js
> 9b8cebc0421241d087f6ab7e815285af803de7e7

@chilts
Copy link

chilts commented Feb 24, 2013

That's real nice! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment