On Sat, 19 Apr 2008 00:02:29 -0400, Lew <lew@lewscanon.com> wrote,
quoted or indirectly quoted someone who said :
Another point is that hashes are explicitly ints, not bitmaps. It's
more natural and self-documenting to use integer operations on them.
On the other hand, hashCodes are just patterns, not quantities, so you
could also argue it makes sense to use the integer bit manipulator
operators on them.
I was wondering if you get any better spread with + or ^ under some
circumstances.
Assume your numbers were all multiples of 4. With +, the hashcode
would always end in 2 zeros. With xor it would end in either 2 zeros
or 2 ones, but in neither case would you get those lower 2 bits nicely
scrambled.
to the real requirement. If my numbers were all multiples of 4, that
likelihood of collision for non-equal values would remain small. That's