-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Description
Blocked By
#9572
https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1937630
Context
#9387 introduced improved hashing for [MSBuild]::StableStringHash
, that however broke internal functionality relying on the hash to be stable between versions (despite documented otherwise).
Proposal
The easiest way around it is to keep the current property function untouched, but introduce a new overload taking an enum argument:
<!-- Works unchanged -->
[MSBuild]::StableStringHash($x)
<!--
$hashAlgo will currently allow:
'GetHashCode' - the legacy behavior (mimicking string.GetHashCode)
'FNV1a_32' - Fawler-Noll-Vo 1a 32bit
-->
[MSBuild]::StableStringHash($x, $hashAlgo)
This way other hashes (like xxHash) can be introduced in the future
Related
- Moving from SHA1 to SHA256 for Hash task #8812 - leveraging the FNV, we can improve the speed of
Hash
task (as we contemplated usage of xxHash) - The property function StableStringHash is relatively weak on some input #7131