public class IntHashCode extends Object
| Constructor and Description |
|---|
IntHashCode() |
| Modifier and Type | Method and Description |
|---|---|
static int |
hashCode(int key)
Computes a hashcode for an integer
|
static int |
hashCode(int[] keys)
Computes the hashcode of an array of integers
|
static int |
hashCode(int[] keys,
int len,
int seed)
Computes the hashcode of an array of integers
|
public static int hashCode(int key)
Inspired by Thomas Wang's function, described at http://www.concentric.net/~ttwang/tech/inthash.htm
key - the given integerpublic static int hashCode(int[] keys)
keys - the given integer arraypublic static int hashCode(int[] keys,
int len,
int seed)
It is based on MurmurHash3 Algorithm, described at http://sites.google.com/site/murmurhash
keys - the given integer arraylen - number of elements to include, that is
len <= keys.lengthseed - initial seedCopyright © 2016. All rights reserved.