As previously defined, the following both returned the same value for
given values of 'basis':
hash_int(0, hash_int(1, basis))
hash_int(1, hash_int(0, basis))
because hash_int(0, basis) evaluated to basis and hash_int(1, basis)
evaluated to c + basis for some constant c.
This commit fixes the problem, by eliminating any simple linear
relationship between basis and the hash value.
We should write some tests for hash function quality.
x ^= x >> 17;
x -= x << 9;
x ^= x << 4;
+ x += basis;
x -= x << 3;
x ^= x << 10;
x ^= x >> 15;
- return x + basis;
+ return x;
}
/* An attempt at a useful 1-bit hash function. Has not been analyzed for