-
Notifications
You must be signed in to change notification settings - Fork 47.4k
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
Bug: Replace md5 with sha256 in createFastHash(). #31748
Comments
|
Kwamanabrown1@Gateway229 |
@Gateway229 what's your meaning? |
|
Any connection with react project?🤔 |
code at:
|
Since 2013, intel has supported instruction set acceleration for sha256. (AMD is following suit.) So SHA256 is faster than MD5. |
I think someone should fix this problem. I think it will be fixed quickly. But I have no experience with js development, and if you could submit a PR to fix it, that would have a positive impact on React speed. |
Is anyone doing this I'd like to fix it. |
I finished it yesterday @cryptochecktool and submitted a PR. |
1.MD5 has potential collision risks.
2.Even for speed considerations, MD5 is slower than SHA256, so replacing MD5 with SHA256 is worthwhile.
code at:
react/packages/react-server/src/ReactServerStreamConfigNode.js
Lines 234 to 238 in e06c72f
Below are the speed test results(:
String Length: 16
MD5 Average Time: 0.0148 ms
SHA256 Average Time: 0.0131 ms
String Length: 256
MD5 Average Time: 0.0193 ms
SHA256 Average Time: 0.0175 ms
String Length: 10000
MD5 Average Time: 0.5830 ms
SHA256 Average Time: 0.4030 ms
String Length: 100000
MD5 Average Time: 6.2866 ms
SHA256 Average Time: 4.6130 ms
code is
The text was updated successfully, but these errors were encountered: