Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect hash generated when binary data is supplied using a binary string. #24

Open
jordanmack opened this issue Mar 17, 2019 · 0 comments

Comments

@jordanmack
Copy link

jordanmack commented Mar 17, 2019

An incorrect hash is may be generated if a binary string is used. In my case, I was obtaining the string from a FileReader instance's readAsBinaryString() method. It seems to work fine with text files, but binary files throw it off and silently give the wrong hash. Using the recommended method of readAsArrayBuffer() works fine as long as you convert it to Uint8Array before passing it to the hasher via update().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant