I've found https://github.com/cespare/mph as a minimal perfect hash, but it seems that it uses 32 bit function (I want 64 one). Is there a way to replace the function and make it work along with the rest part of the code?
CodePudding user response:
Yes. The steps are:
- Read the paper and understand it.
- Read the code and understand it.
- Make the necessary changes.
There's nothing in the algorithm that depends on a specific hash output size, so you can change it to anything you want, as long as the hash family you supply meets the requirements of section 1.3.
Probably it just requires changing all of the uint32
to uint64
in mph.go
, and replacing all of murmur.go
with a new 64-bit implementation; you just have to make sure that that new 64-bit hash is good.