srijs / rusha

High-performance pure-javascript SHA1 implementation suitable for large binary data, reaching up to half the native speed.
https://npmjs.org/rusha
MIT License
277 stars 32 forks source link

Wrong hash when hashing close to 1GB #29

Closed kalley closed 8 years ago

kalley commented 9 years ago

I couldn't track down the exact spot where I started getting problems, but it's very close to 1GB.

This is tested against node's crypto library as well as c#'s hashing (which are both the same).

I'm digging around in the SHA1 spec, but I don't really have that kind of background.

srijs commented 9 years ago

Hi, and thanks for filing this bug. Before I start investigating this, could you please provide me with:

kalley commented 9 years ago

Using version 0.8.2 in the browser (web worker).

Passing a File object.

srijs commented 9 years ago

Did you test with multiple browsers, or just one? Which versions?

kalley commented 9 years ago

These all generate the same (wrong) hash: Firefox version 36.0.4 Chrome version 43.0.2357.81 Internet Explorer 11.0.9600.17801

If it helps, I've been testing with zip files, uploaded using either a file input or drag and drop. There is no difference between using either of source of input.

srijs commented 8 years ago

This should be fixed in version 0.8.4.