-
-
Notifications
You must be signed in to change notification settings - Fork 759
feat: add support for SHA-256 #10553
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
Conversation
✅ Deploy Preview for rspack canceled.Built without sensitive environment variables
|
@pgoldberg can you help explain more how the project relys on SHA-256 content hashes? |
Sure! I use a content-addressable storage model for serving static files from many bundles, where files from these bundles are all accessible via the same route (e.g. Using a cryptographic hash, like SHA256, has made the security model of this solution easier to reason about in the event these bundles may come from several sources, because it removes the possibility of a dev constructing an intentional hash collision that allowed a file from one bundle to be injected into a different bundle. The two options provided by Rspack today, |
6f3e95f
to
e30473a
Compare
CodSpeed Performance ReportMerging #10553 will not alter performanceComparing Summary
|
b376617
to
f65df7e
Compare
@hardfist Just wanted to nudge this one – I'm hoping to get this in for a project I'm working on. I'm happy to clarify any questions you might have about it! |
@pgoldberg thanks for your contribution, LGTM |
@pgoldberg you also need to update the api snapshot by running ./x ae update |
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.
Since we don't provide consistent output with webpack, we could use a more modern algorithm here (like blake3). but for now sha2 is good enough.
@hardfist Thank you – just pushed that up! |
7085246
to
eae3956
Compare
@pgoldberg i tried to fix the CI and merged main branch. |
Summary
Rspack doesn't support SHA-256 hashes, which makes migrating from Webpack difficult for projects that rely on SHA-256 content hashes, since it only supports MD4 and xxHash64. This PR adds support for SHA-256.
Checklist