Skip to content

Binary data not hashed correctly #14

Description

@kornelski
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()?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions