-
Notifications
You must be signed in to change notification settings - Fork 1.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
Introduce intrinsic stable hash function Fixes #4986 #5723
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This method hashes a string without taking target framework or bitness into account. Fixes dotnet#4986
cdmihai
approved these changes
Sep 10, 2020
benvillalobos
approved these changes
Sep 10, 2020
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.
LGTM!
ladipro
approved these changes
Sep 11, 2020
Comment on lines
3618
to
3626
(int)expander.ExpandPropertiesLeaveTypedAndEscaped("$([MSBuild]::StableStringHash('cat1s'))", ExpanderOptions.ExpandProperties, MockElementLocation.Instance), | ||
(int)expander.ExpandPropertiesLeaveTypedAndEscaped("$([MSBuild]::StableStringHash('cat1z'))", ExpanderOptions.ExpandProperties, MockElementLocation.Instance), | ||
(int)expander.ExpandPropertiesLeaveTypedAndEscaped("$([MSBuild]::StableStringHash('bat1s'))", ExpanderOptions.ExpandProperties, MockElementLocation.Instance), | ||
(int)expander.ExpandPropertiesLeaveTypedAndEscaped("$([MSBuild]::StableStringHash('cut1s'))", ExpanderOptions.ExpandProperties, MockElementLocation.Instance), | ||
(int)expander.ExpandPropertiesLeaveTypedAndEscaped("$([MSBuild]::StableStringHash('cat1so'))", ExpanderOptions.ExpandProperties, MockElementLocation.Instance), | ||
(int)expander.ExpandPropertiesLeaveTypedAndEscaped("$([MSBuild]::StableStringHash('cats1'))", ExpanderOptions.ExpandProperties, MockElementLocation.Instance), | ||
(int)expander.ExpandPropertiesLeaveTypedAndEscaped("$([MSBuild]::StableStringHash('acat1s'))", ExpanderOptions.ExpandProperties, MockElementLocation.Instance), | ||
(int)expander.ExpandPropertiesLeaveTypedAndEscaped("$([MSBuild]::StableStringHash('cat12s'))", ExpanderOptions.ExpandProperties, MockElementLocation.Instance), | ||
(int)expander.ExpandPropertiesLeaveTypedAndEscaped("$([MSBuild]::StableStringHash('cat1s'))", ExpanderOptions.ExpandProperties, MockElementLocation.Instance) |
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.
nit: Perhaps you could create an array with just the strings to hash ("cat1s", "cat1z", ...
) to eliminate code/text duplication.
rainersigwald
approved these changes
Sep 11, 2020
Forgind
force-pushed
the
stable-hash
branch
from
September 11, 2020 16:59
7cc7ed5
to
a0bbd93
Compare
Forgind
commented
Oct 2, 2020
sujitnayak
pushed a commit
to NikolaMilosavljevic/msbuild
that referenced
this pull request
Oct 12, 2020
Add StableStringHash method This method hashes a string without taking target framework or bitness into account. Fixes dotnet#4986 Test StableStringHash
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #4986 by introducing a new, stable hash function. Takes the safe route of not overwriting the previous hash function.