On Wed, May 31, 2006 at 11:41:27AM -0700, David Miller (davem@davemloft.net) wrote: > > > Worse: he folded the jenkins algorith result with > > > > > > h ^= h >> 16; > > > h ^= h >> 8; > > > > > > Destroying the coverage of the function. > > > > It was done to simulate socket code which uses the same folding. > > Leaving 32bit space is just wrong, consider hash table size with that > > index. > > You absolutely show not do this shifting on the jenkins hash > result, you destroy the distribution entirely. Just mask > it with the hash mask and that's all you need to do. > > Brian is right, this is absolutely critical to using the Jenkins hash > correctly. You're "unmixing" the bits it worked so hard to mix. That is wrong. And I have a code and picture to show that, and you dont - prove me wrong :) Attached code and picture which shows _exactly_ the same distribution for folded and not folded Jenkins hash distribution, and it's artifact compared to XOR hash. Fairly distributed values being XORed produce still fairly distributed value. -- Evgeniy Polyakov