-
Couldn't load subscription status.
- Fork 162
rm js-sha256 #2539
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
base: main
Are you sure you want to change the base?
rm js-sha256 #2539
Conversation
b82f48e to
7c866d1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me
Question: do we need to include the audit for the crypto libraries we use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
commit: |
| } | ||
|
|
||
| function computeChecksum(input: number[] | Uint8Array) { | ||
| let inputBytes = input instanceof Uint8Array ? input : new Uint8Array(input); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: let inputBytes = new Uint8Array(input); should be enough
js-sha256 edits the prototype, and Lumina noticed that sporadically, they got an error where this behavior is the primary suspect: https://github.com/emn178/js-sha256/blob/bacba8e8c6d6a79a6505ba52edbad55ec5509b19/src/sha256.js#L394
Modifying the prototype can be blocked in certain runtimes and bundlers that freeze objects by default, but since it doesn't happen every time, it's hard to pinpoint the exact issue.
I'd like to package this PR as a branch release and provide it to the Lumina team to test with.