fs.readFile(file_path, undefined, function(err, data) {
console.log(hashlib.sha1(data));
});
If file at file_path contains ASCII, the hash is correct. However, binary files get wrong hash.
Could you add support for this case? (as far as I understand, in this case node.js returns data in raw encoding, so sha1() could read it properly). Alternatively, add sha1_file()?