magic number 32821 (Attn. frede)

Dave Jones djones at megatest.UUCP
Tue Sep 27 11:42:44 AEST 1988


I attempted to send this reply directly to frede at hplabs, but it 
got bounced.

He wanted to know where in Sedgewick I found the number 32821 as
a good candidate to multiply integers by in order to "splatter" them
around as part of a hash function.  I could have been more informative.
Sedgewick does not recommend the technique for hashing. It's in the section 
on linear-congruential random number generators. 

Of course, just multiplying by this number may not
splatter things enough for a good hash-function.  If the input numbers
are all even, for example, the splattered numbers will also be all even.

Caveat Multiplicator.



More information about the Comp.lang.c mailing list