-
Notifications
You must be signed in to change notification settings - Fork 9.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
replace hash algorithm from sha256 to xxh128 for performance reasons #37441
base: 2.4-develop
Are you sure you want to change the base?
Conversation
Hi @Nuranto. Thank you for your contribution! Add the comment under your pull request to deploy test or vanilla Magento instance:
❗ Automated tests can be triggered manually with an appropriate comment:
Allowed build names are:
You can find more information about the builds here For more details, review the Code Contributions documentation. |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
@magento run WebAPI Tests, Static Tests, Integration Tests, Functional Tests EE, Functional Tests B2B |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
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.
@Nuranto Thanks for update.
I'm agree with most of updates where hash used for some internal calculations like cache key.
But xxhash is non-cryptographic algorithm and I'm not sure that it should be used for data that send to the browser.
I believe that we should discuss it with Magento team.
cc @sidolov @maghamed
@@ -88,7 +88,7 @@ public function __construct( | |||
*/ | |||
private function generateHashValue(string $content): array | |||
{ | |||
return [base64_encode(hash('sha256', $content, true)) => 'sha256']; | |||
return [base64_encode(hash('xxh128', $content, true)) => 'sha256']; |
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.
hash algorithm changes in array key, but it's not changed in value, that used for preparing header.
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.
I indeed missed this one :/
Before editing this, I'll wait for Magento team feedback on which algo we should use here.
Thanks
Description (*)
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
Questions or comments
Contribution checklist (*)