3 ms·
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,
by daeken 12y ago
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.
- MichaelGG 12y agoAlso is it not for hash collision protection, which can end up hurting the runtime of many algorithms, causing a DoS?
- plorkyeran 12y agoNo, 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.
- porges 12y agoIt won't help much there as the number is static for a particular build.
- munificent 12y agoThe hash randomization for security is above this part of the code.
- evincarofautumn 12y agoBut now I can circumvent this hack by xoring with ThisAssembly.DailyBuildNumber again. :)
- rplnt 12y agoI 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".