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

Use MD4 for hashing #6549

Merged
merged 1 commit into from Feb 24, 2018
Merged

Use MD4 for hashing #6549

merged 1 commit into from Feb 24, 2018

Conversation

ooflorent
Copy link
Member

What kind of change does this PR introduce?

build related change

Did you add tests for your changes?

yes

If relevant, link to documentation update:

n/a

Summary

md4 is faster than md5. Since webpack doesn't need secure hashes, md4 could be used to improve the build performance.

Does this PR introduce a breaking change?

no

@montogeek
Copy link
Member

How much is improved?

@ooflorent
Copy link
Member Author

md4 is about 20% faster than md5. On large builds it could lead to a 2-3% overall improvement.

@webpack-bot
Copy link
Contributor

Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon.

@quantizor
Copy link
Contributor

If you're switching hash functions, murmur2 is well-loved for a good balance between speed and uniqueness on non-cryptographic use cases. I tried looking around and couldn't find any direct comparison benchmarks though.

Here's a JS implementation example: https://github.com/emotion-js/emotion/blob/master/packages/emotion-utils/src/hash.js

@sokra sokra merged commit 6e175bc into master Feb 24, 2018
@sokra
Copy link
Member

sokra commented Feb 24, 2018

Thanks

@sokra sokra deleted the md4_hash branch February 24, 2018 11:06
@connorjclark
Copy link

Great idea!

apepper added a commit to Scrivito/scrivito_example_app_js that referenced this pull request Mar 26, 2020
Webpack uses md4 for all hashes by default (see [1] and [2])

[1] webpack/webpack#6549
[2] webpack/loader-utils#114
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants