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

improved hashing function ------> Packages/react-refresh/src/ReactFreshBabelPlugin.js #22586

Closed
wants to merge 1 commit into from

Conversation

Biki-das
Copy link
Contributor

updated the 'sha1' ----> 'sha256'

@Biki-das Biki-das changed the title improved hashing function improved hashing function ------> Packages/react-refresh/src/ReactFreshBabelPlugin.js Oct 19, 2021
@@ -308,7 +308,7 @@ export default function(babel, opts = {}) {
// We also need it for www that has transforms like cx()
// that don't understand if something is part of a string.
finalKey = require('crypto')
.createHash('sha1')
.createHash('sha256')
Copy link
Contributor

Choose a reason for hiding this comment

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

I think sha256 is significantly slower than sha1. Is there a reason sha1 isn't good enough for this use case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well yeah as you said "sha1" Is faster the reason i suggested it to "sha256" Is security purpose, "sha1" Has been vulnerable to browser collision attacks and overall it is less secure compared to "sha256"

Copy link
Contributor

Choose a reason for hiding this comment

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

Fast Refresh is not using the hashing function in a way that has security implications.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bvaughn so what do you think should i close this for now?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, probably.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok doing that , thanks for the review!

@Biki-das Biki-das closed this Oct 20, 2021
@Biki-das Biki-das deleted the newwork branch October 20, 2021 13:20
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

3 participants