You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.
At some point the API changed in a way which causes the SHA functions to return technically correct but wrong results. I had a web worker which looked like this:
This worked with older versions but with the current version it returns the hash of an empty buffer (e.g. SHA-256 = e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855) because ArrayBuffer doesn't have a length property and so the data length loop exits immediately without an error:
It wasn't that hard to find this and change sha256.process(bytes) to sha256.process(new Uint8Array(bytes)) but it'd be really nice if that code threw an exception to make the problem obvious since it might otherwise go unnoticed until someone actually checked the hashes or wondered why every file returned the same hash.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
At some point the API changed in a way which causes the SHA functions to return technically correct but wrong results. I had a web worker which looked like this:
This worked with older versions but with the current version it returns the hash of an empty buffer (e.g. SHA-256 =
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
) becauseArrayBuffer
doesn't have alength
property and so the data length loop exits immediately without an error:asmcrypto.js/src/hash/hash.ts
Lines 34 to 37 in b6eb05d
It wasn't that hard to find this and change
sha256.process(bytes)
tosha256.process(new Uint8Array(bytes))
but it'd be really nice if that code threw an exception to make the problem obvious since it might otherwise go unnoticed until someone actually checked the hashes or wondered why every file returned the same hash.The text was updated successfully, but these errors were encountered: