-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Switch to the Web Crypto API for generating SHA checksums #21522
Conversation
This looks good, thanks! Did you check that the computed checksums are the same before and after? (Do our tests validate that and compare to some CLI output?) Can you please refresh/fix the node_modules build? |
a2e795c
to
7c486bf
Compare
For development I basically did a So on Fedora it defaults to SHA-256 and this is validated by getting the hash from So one of them is tested in CI,
|
This allows us to drop the two pure JavaScript implementations of SHA-1 and SHA-256. These native Web Crypto API is available as baseline and allows us to easily switch over to SHA-512 without adding a new dependency.
7c486bf
to
d576a10
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.
Eeexcellent, dankjewel!
} catch (err) { | ||
console.warn("Unable to create a sha256 hash", err); |
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.
These 2 added lines are not executed by any test.
} catch (err) { | ||
console.warn("Unable to create a sha1 hash", err); |
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.
These 2 added lines are not executed by any test.
This allows us to drop the two pure JavaScript implementations of SHA-1 and SHA-256. These native Web Crypto API is available as baseline and allows us to easily switch over to SHA-512 without adding a new dependency.