1

I am stuck trying to implement the perfect hashing technique using universal hashing at each level from Cormen. Specifically, with the compression method (at least, I think here is my problem).

I am working on strings, I think short strings (between 8 and 150), and for that, I have my set of hash functions with Murmur3/2, xxhash, FNV1, Cityhash and Spookyhash, using the 64-bits keys (for those hash functions like spookyhash I am getting the lower 64-bits), the problem is that there exist collissions with only three unique strings (two of 10 characters and one of 11 characters) in 9 buckets.

I am using the Cormen's hash compression method for that:

h_ab(k) = ((ak+b)mod p) mod m

with a = 3, p = 4294967291 (largest 32-bit prime), b = 5 and m = 9 (because m_j should be the square of n_j). As "k" I am using the hash value returned by the hash function (like murmur).

If for example, I am using a hash function like murmur2 (64-bit version), the p number should be the largest 64-prime number? I that way, I am covering all possibles hashes that murmur could return, is that right?

Which other hash compressions techniques (apart of division) exist and do you recommend?

Any reference, hint, book, paper, help is pretty welcome. Sorry for the silly question, I am pretty newbie with hash functions and hash tables.

Thanks in advance.

germelcar
  • 56
  • 6

0 Answers0