Re: Hash functions (was Re: 2.2.6_andrea2.bz2)

Harvey J. Stein (hjstein@bfr.co.il)
07 May 1999 17:01:12 +0300


Andrea Arcangeli <andrea@e-mind.com> writes:

> On Thu, 6 May 1999, Chuck Lever wrote:
>
> >that's one reason why you don't use the LSB of the multiplication result.
> >instead, it is right-shifted so you get the middle bits, which are much
> >more likely to be "random."
>
> BTW: 2**32*(sqrt(5)-1)/2 is 2654435770 and not 2654425957UL that you are
> using in your hashfn. So were does 2654425957UL came from?

It's a nearby prime.

-- 
Harvey J. Stein
BFM Financial Research
hjstein@bfr.co.il

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/