Skip to content

Instantly share code, notes, and snippets.

@sunnycmf
Forked from guybrush/gist:721762
Created February 18, 2014 02: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 sunnycmf/9063495 to your computer and use it in GitHub Desktop.
Save sunnycmf/9063495 to your computer and use it in GitHub Desktop.
calculate a file sha1 checksum
#!/usr/bin/env node
require('fs').readFile('image.png',function(err, data){
console.log(require('crypto').createHash('sha1').update(data).digest('hex'))
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment