
1 Feb
2010
1 Feb
'10
9:05 p.m.
On Feb 1, 2010, at 9:04 AM, Hans Aberg wrote:
A simple hash-function for strings is to simply exclusive-or the bytes and then reduce modulo a prime number,
Simply exclusive-oring the bytes will give you at most 256 distinct results. (For an ASCII source, 128 distinct results.) After that, there hardly seems to be any point in reduction modulo a prime. This approach can't tell a CAT from an ACT or a DOG from a GOD, which is another strike against it. (It also can't tell a TITTLE from a TILE, or a BOTTLE from a BOLE, for obvious reasons.)