The number 36 is composite: 36 = 2^2 x 3^2.

Long experience with division-method hashing schemes has established
that the use of composite hashing moduli produces significant
clustering at their prime factors.  Here you may expect
disproportionately high numbers of the hash values 2 and 3.

For a hashing modulus of 46 = 2 x 23 clustering instead occurs at 2 and 23.

Without knowing more about the uses you plan to make of these hash
values it is hard to know how serious a limitation this clustering
will be, but you should be aware of it.

Also worth noting is that if 37 had been chosen as the hashing modulus
originally---say by treating A-Z, 0-9, and $ as licit
characters---clustering would have been avoided entirely because 37 is
prime.

Analogously and serendipitously, if you made 47 characters licit, thus
making 47 your hashing modulus, you could avoid clustering too since
47 is also prime.

John Gilmore, Ashland, MA 01721 - USA

Reply via email to