public final class HashFunctions extends Object
Note: the hash numbers may be smaller than zero. you may AND them with the mask 0x7FFFFFFF to fix that.
Each hash function in good in its own place. for example, pair() may give bad results in the chi^2 test, but it is the better hash in some situations.
| Constructor and Description |
|---|
HashFunctions() |
| Modifier and Type | Method and Description |
|---|---|
static int |
hash_FNV(int[] data,
int offset,
int len)
hash the 32-bit array with FNV
|
static int |
hash_FNV(int a,
int b,
int c)
32-bit hash of FNV with 3 32-bit words input.
|
static int |
hash_jenkins(int a,
int b,
int c)
This hash function was suggested by Bob Jenkins (of Oracle).
|
static int |
hash_pair(int a,
int b)
pair-hash for two elements
|
static int |
hash_pair(int a,
int b,
int c)
pair-hash for three elements
|
static int |
hash_prime(int a,
int b)
prime-hash for two elements
|
static int |
hash_prime(int a,
int b,
int c)
prime-hash for three elements
|
static void |
internal_test() |
static int |
mix_jenkins(int i)
Robert Jenkins' bit mix function
|
static int |
mix_wang(int i)
Thomas Wang's 32 bit mix function
|
static int |
mix(int i)
mix the bits in i in some clever way.
|
public static final int mix(int i)
Use this one when you dont know much about i. NOTE: it is slower then the others
public static final int mix_wang(int i)
public static final int mix_jenkins(int i)
public static final int hash_pair(int a,
int b)
public static final int hash_pair(int a,
int b,
int c)
public static final int hash_prime(int a,
int b)
public static final int hash_prime(int a,
int b,
int c)
public static final int hash_jenkins(int a,
int b,
int c)
public static final int hash_FNV(int a,
int b,
int c)
This hash functions is probably best for strings than 3-tupple integers.
public static final int hash_FNV(int[] data,
int offset,
int len)
public static void internal_test()
This file is a part of the JDD package, a native Java Binary Decision Diagram Library.