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 instead of sha1 for filename hashes #638

Merged
merged 1 commit into from Jul 5, 2018
Merged

Conversation

lencioni
Copy link
Contributor

@lencioni lencioni commented Jul 5, 2018

We don't need the cryptographic strength of SHA-1 for this purpose, so
we may as well use a faster hashing algorithm.

While I was at it, I also sapped out the use of hash.end + hash.read
combo for the faster and more conventional hash.update + hash.digest. In
my local testing, this also seems to offer a nice speed boost.

Please check if the PR fulfills these requirements

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior? (You can also link to an open issue here)

Uses SHA-1 for cache filename hash.

What is the new behavior?

Uses MD4 for cache filename hash.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information:

I wrote this PR against the 7.x branch in hopes that we could get it into a 7.x release. If you think this is a good approach, I am happy to open a similar PR against master.

@lencioni lencioni changed the base branch from master to 7.x July 5, 2018 11:50
We don't need the cryptographic strength of SHA-1 for this purpose, so
we may as well use a faster hashing algorithm.

While I was at it, I also sapped out the use of hash.end + hash.read
combo for the faster and more conventional hash.update + hash.digest. In
my local testing, this also seems to offer a nice speed boost.
Copy link
Member

@xtuc xtuc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Webpack did that too

@xtuc xtuc merged commit fa91723 into babel:7.x Jul 5, 2018
@existentialism
Copy link
Member

We should land this change in master too?

@xtuc
Copy link
Member

xtuc commented Jul 5, 2018

Yes that's a good idea.

@hzoo
Copy link
Member

hzoo commented Jul 5, 2018

And we can release this as a patch?

@hzoo
Copy link
Member

hzoo commented Jul 5, 2018

https://github.com/babel/babel-loader/releases/tag/v7.1.5

This was referenced Jun 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants