IntPerfectHash

A minimum perfect hash function tool. It needs about 2.2 bits per key.

Methods
static byte[] generate(ArrayList list)
Generate the minimal perfect hash function data from the given list.
static byte[] generate(ArrayList list)
Generate the minimal perfect hash function data from the given list.
Parameters:
list - the data
Returns:
the hash function description
IntPerfectHash(byte[] data)
Create a hash object to convert keys to hashes.
IntPerfectHash(byte[] data)
Create a hash object to convert keys to hashes.
Parameters:
data - the data returned by the generate method
int get(int x)
Calculate the hash value for the given key.
int get(int x)
Calculate the hash value for the given key.
Parameters:
x - the key
Returns:
the hash value
byte[] getData()
Get the hash function description.
byte[] getData()
Get the hash function description.
Returns:
the data