Skip to content

Instantly share code, notes, and snippets.

@w1nk
Created April 22, 2011 17:10
Show Gist options
  • Save w1nk/937112 to your computer and use it in GitHub Desktop.
Save w1nk/937112 to your computer and use it in GitHub Desktop.
not getting any output!
var filename = 'test.manifest'
var crypto = require('crypto');
var fs = require('fs');
var shasum = crypto.createHash('sha1');
var s = fs.ReadStream(filename);
s.on('data', function(d) {
shasum.update(d);
});
s.on('end', function() {
var d = shasum.digest('hex');
console.log(d + ' ' + filename);
});
@w1nk
Copy link
Author

w1nk commented Apr 22, 2011

var filename = 'test.manifest'
var crypto = require('crypto');
var fs = require('fs');

var shasum = crypto.createHash('sha1');

var s = fs.createReadStream(filename);
s.on('data', function(d) {
shasum.update(d);
});

s.on('end', function() {
var d = shasum.digest('hex');
console.log(d + ' ' + filename);
});

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