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()?
fs.readFile(file_path, undefined, function(err, data) { console.log(hashlib.sha1(data)); });If file at
file_pathcontains 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
rawencoding, sosha1()could read it properly). Alternatively, addsha1_file()?