public final class MurmurHash3
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
MurmurHash3.IncrementalHash32 |
Modifier and Type | Field and Description |
---|---|
private static long |
C1 |
private static int |
C1_32 |
private static long |
C2 |
private static int |
C2_32 |
static int |
DEFAULT_SEED |
(package private) static int |
INTEGER_BYTES
TODO Replace on Java 8 with Integer.BYTES.
|
(package private) static int |
LONG_BYTES
TODO Replace on Java 8 with Long.BYTES.
|
private static int |
M |
private static int |
M_32 |
private static int |
N_32 |
private static int |
N1 |
private static int |
N2 |
static long |
NULL_HASHCODE |
private static int |
R1 |
private static int |
R1_32 |
private static int |
R2 |
private static int |
R2_32 |
private static int |
R3 |
(package private) static int |
SHORT_BYTES
TODO Replace on Java 8 with Short.BYTES.
|
Modifier | Constructor and Description |
---|---|
private |
MurmurHash3() |
Modifier and Type | Method and Description |
---|---|
private static int |
fmix32(int length,
int hash) |
private static long |
fmix64(long h) |
static long[] |
hash128(byte[] data)
Murmur3 128-bit variant.
|
static long[] |
hash128(byte[] data,
int offset,
int length,
int seed)
Murmur3 128-bit variant.
|
static long[] |
hash128(java.lang.String data)
Murmur3 128-bit variant.
|
static int |
hash32(byte[] data)
Generates 32 bit hash from byte array with the default seed.
|
static int |
hash32(byte[] data,
int length)
Generates 32 bit hash from byte array with the default seed.
|
static int |
hash32(byte[] data,
int length,
int seed)
Generates 32 bit hash from byte array with the given length and seed.
|
static int |
hash32(byte[] data,
int offset,
int length,
int seed)
Generates 32 bit hash from byte array with the given length, offset and seed.
|
static int |
hash32(long l0)
Generates 32 bit hash from a long with default seed value.
|
static int |
hash32(long l0,
int seed)
Generates 32 bit hash from a long with the given seed.
|
static int |
hash32(long l0,
long l1)
Generates 32 bit hash from two longs with default seed value.
|
static int |
hash32(long l0,
long l1,
int seed)
Generates 32 bit hash from two longs with the given seed.
|
static int |
hash32(java.lang.String data)
Generates 32 bit hash from a string with the default seed.
|
static long |
hash64(byte[] data)
Murmur3 64-bit variant.
|
static long |
hash64(byte[] data,
int offset,
int length)
Generates 64 bit hash from byte array with the given length, offset and
default seed.
|
static long |
hash64(byte[] data,
int offset,
int length,
int seed)
Generates 64 bit hash from byte array with the given length, offset and seed.
|
static long |
hash64(int data)
Murmur3 64-bit variant.
|
static long |
hash64(long data)
Murmur3 64-bit variant.
|
static long |
hash64(short data)
Murmur3 64-bit variant.
|
private static int |
mix32(int k,
int hash) |
private static int |
orBytes(byte b1,
byte b2,
byte b3,
byte b4) |
static final int LONG_BYTES
static final int INTEGER_BYTES
static final int SHORT_BYTES
public static final long NULL_HASHCODE
private static final int C1_32
private static final int C2_32
private static final int R1_32
private static final int R2_32
private static final int M_32
private static final int N_32
private static final long C1
private static final long C2
private static final int R1
private static final int R2
private static final int R3
private static final int M
private static final int N1
private static final int N2
public static final int DEFAULT_SEED
public static int hash32(long l0, long l1)
l0
- long to hashl1
- long to hashpublic static int hash32(long l0)
l0
- long to hashpublic static int hash32(long l0, int seed)
l0
- long to hashseed
- initial seed valuepublic static int hash32(long l0, long l1, int seed)
l0
- long to hashl1
- long to hashseed
- initial seed valuepublic static int hash32(byte[] data)
data
- - input byte arraypublic static int hash32(java.lang.String data)
data
- - input stringpublic static int hash32(byte[] data, int length)
data
- - input byte arraylength
- - length of arraypublic static int hash32(byte[] data, int length, int seed)
data
- - input byte arraylength
- - length of arrayseed
- - seed. (default 0)public static int hash32(byte[] data, int offset, int length, int seed)
data
- - input byte arrayoffset
- - offset of datalength
- - length of arrayseed
- - seed. (default 0)public static long hash64(byte[] data)
data
- - input byte arraypublic static long hash64(long data)
data
- - input longpublic static long hash64(int data)
data
- - input intpublic static long hash64(short data)
data
- - input shortpublic static long hash64(byte[] data, int offset, int length)
data
- - input byte arrayoffset
- - offset of datalength
- - length of arraypublic static long hash64(byte[] data, int offset, int length, int seed)
data
- - input byte arrayoffset
- - offset of datalength
- - length of arrayseed
- - seed. (default 0)public static long[] hash128(byte[] data)
data
- - input byte arraypublic static long[] hash128(java.lang.String data)
data
- - input Stringpublic static long[] hash128(byte[] data, int offset, int length, int seed)
data
- - input byte arrayoffset
- - the first element of arraylength
- - length of arrayseed
- - seed. (default is 0)private static int mix32(int k, int hash)
private static int fmix32(int length, int hash)
private static long fmix64(long h)
private static int orBytes(byte b1, byte b2, byte b3, byte b4)