Re:CoreCLR is now open source
by daeken on Tuesday February 03, 2015 @01:37PM
(#8992241)
I don't know the story, but the logic behind it is simple: If you want to guarantee no one depends on GetHashCode staying static between runs of an application, change it all the time.
[ Parent
| on HN ]
Re:CoreCLR is now open source
by evincarofautumn on Tuesday February 03, 2015 @04:53PM
(#8993673)
But now I can circumvent this hack by xoring with ThisAssembly.DailyBuildNumber again. :)
I think the story is even simpler than that as the code in question is prefaced with: #if DEBUG
The shipped product doesn't include this "randomness".
Also is it not for hash collision protection, which can end up hurting the runtime of many algorithms, causing a DoS?
Re:CoreCLR is now open source
by plorkyeran on Tuesday February 03, 2015 @02:17PM
(#8992567)
No, it has no effect on hash collisions. Two hashes that are equal before being xored with the daily build number will still be equal afterwards.
It won't help much there as the number is static for a particular build.
Re:CoreCLR is now open source
by munificent on Tuesday February 03, 2015 @03:37PM
(#8993172)
The hash randomization for security is above this part of the code.