MinimalPerfectHash.StringHash

A sample hash implementation for integer keys.

Methods
static int getFastHash(String o, int index, int seed)
A cryptographically weak hash function.
static int getFastHash(String o, int index, int seed)
A cryptographically weak hash function. It is supposed to be fast.
Parameters:
o - the string
index - the hash function index
seed - the seed
Returns:
the hash value
static int getSipHash24(String o, long k0, long k1)
A cryptographically relatively secure hash function.
static int getSipHash24(String o, long k0, long k1)
A cryptographically relatively secure hash function. It is supposed to protected against hash-flooding denial-of-service attacks.
Parameters:
o - the string
k0 - key 0
k1 - key 1
Returns:
the hash value
static int getSipHash24(byte[] b, int start, int end, long k0, long k1)
A cryptographically relatively secure hash function.
static int getSipHash24(byte[] b, int start, int end, long k0, long k1)
A cryptographically relatively secure hash function. It is supposed to protected against hash-flooding denial-of-service attacks.
Parameters:
b - the data
start - the start position
end - the end position plus one
k0 - key 0
k1 - key 1
Returns:
the hash value
int hashCode(String o, int index, int seed)
int hashCode(String o, int index, int seed)