Created
April 22, 2011 17:10
-
-
Save w1nk/937112 to your computer and use it in GitHub Desktop.
not getting any output!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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);
});