public class MurmurHash extends Object
See http://murmurhash.googlepages.com/ for mre details.
Modifier and Type | Method and Description |
---|---|
static int |
hash(byte[] data,
int seed)
Hashes bytes in an array.
|
static int |
hash(byte[] data,
int off,
int len,
int seed)
Hashes bytes in part of an array.
|
static int |
hash(ByteBuffer buf,
int seed)
Hashes the bytes in a buffer from the current position to the limit.
|
static int |
hash(int data,
int seed)
Hashes an int.
|
static int |
hash3X86(byte[] data,
int off,
int len,
int seed)
This produces exactly the same hash values as the final C+ version of MurmurHash3 and is
thus suitable for producing the same hash values across platforms.
|
static long |
hash64A(byte[] data,
int seed) |
static long |
hash64A(byte[] data,
int off,
int len,
int seed) |
static long |
hash64A(ByteBuffer buf,
int seed) |
public static int hash3X86(byte[] data, int off, int len, int seed)
The 32 bit x86 version of this hash should be the fastest variant for relatively short keys like IDs.
Note - The x86 and x64 versions do _not_ produce the same results, as the algorithms are optimized for their respective platforms.
See also http://github.com/yonik/java_util for future updates to this method.
data
- Data to hash.off
- Where to start munging.len
- How many bytes to process.seed
- The seed to start with.public static int hash(int data, int seed)
data
- The int to hash.seed
- The seed to start with.public static int hash(byte[] data, int seed)
data
- The bytes to hash.seed
- The seed to start with.public static int hash(byte[] data, int off, int len, int seed)
data
- The data to hash.off
- Where to start munging.len
- How many bytes to process.seed
- The seed to start with.public static int hash(ByteBuffer buf, int seed)
buf
- The bytes to hash.seed
- The seed to start with.public static long hash64A(byte[] data, int seed)
data
- The data to hash.seed
- The seed to start with.public static long hash64A(byte[] data, int off, int len, int seed)
data
- The data to hash.off
- Where to start munging.len
- How many bytes to process.seed
- The seed to start with.public static long hash64A(ByteBuffer buf, int seed)
buf
- The data to hash.seed
- The seed to start with.
Follow @ApacheIgnite
Ignite Fabric : ver. 2.6.0 Release Date : July 10 2018