public class StringMurmurHashFunction extends Object implements HashFunction<String>
Constructor and Description |
---|
StringMurmurHashFunction()
Construct a new
StringMurmurHashFunction with the default seed. |
StringMurmurHashFunction(int seed)
Construct a new
StringMurmurHashFunction with the given seed. |
Modifier and Type | Method and Description |
---|---|
int |
computeHashCode(String data)
Compute the hash code for the object
|
static int |
murmurhash(byte[] data)
Compute the Murmur hash (http://murmurhash.googlepages.com/) of the given
bytes.
|
static int |
murmurhash(byte[] data,
int seed)
Compute the Murmur hash (http://murmurhash.googlepages.com/) of the given
bytes.
|
static int |
murmurhash(byte[] data,
int length,
int seed)
Compute the Murmur hash (http://murmurhash.googlepages.com/) of the given
bytes.
|
public StringMurmurHashFunction()
StringMurmurHashFunction
with the default seed.public StringMurmurHashFunction(int seed)
StringMurmurHashFunction
with the given seed.seed
- the seedpublic int computeHashCode(String data)
HashFunction
computeHashCode
in interface HashFunction<String>
data
- the objectpublic static int murmurhash(byte[] data)
data
- the data to hashmurmurhash(byte[], int, int)
public static int murmurhash(byte[] data, int seed)
data
- the data to hashseed
- the random seedmurmurhash(byte[], int, int)
public static int murmurhash(byte[] data, int length, int seed)
data
- the data to hashlength
- the length of the data to hashseed
- the random seed