Package org.apache.orc.util
Class Murmur3
java.lang.Object
org.apache.orc.util.Murmur3
Murmur3 is successor to Murmur2 fast non-crytographic hash algorithms.
Murmur3 32 and 128 bit variants. 32-bit Java port of https://code.google.com/p/smhasher/source/browse/trunk/MurmurHash3.cpp#94 128-bit Java port of https://code.google.com/p/smhasher/source/browse/trunk/MurmurHash3.cpp#255
This is a public domain code with no copyrights. From homepage of MurmurHash (https://code.google.com/p/smhasher/), "All MurmurHash versions are public domain software, and the author disclaims all copyright to their code."
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic long[]
hash128
(byte[] data) Murmur3 128-bit variant.static long[]
hash128
(byte[] data, int offset, int length, int seed) Murmur3 128-bit variant.static int
hash32
(byte[] data) Murmur3 32-bit variant.static int
hash32
(byte[] data, int length, int seed) Murmur3 32-bit variant.static long
hash64
(byte[] data) Murmur3 64-bit variant.static long
hash64
(byte[] data, int offset, int length) static long
hash64
(byte[] data, int offset, int length, int seed) Murmur3 64-bit variant.
-
Field Details
-
NULL_HASHCODE
public static final long NULL_HASHCODE- See Also:
-
-
Constructor Details
-
Murmur3
public Murmur3()
-
-
Method Details
-
hash32
public static int hash32(byte[] data) Murmur3 32-bit variant.- Parameters:
data
- - input byte array- Returns:
- - hashcode
-
hash32
public static int hash32(byte[] data, int length, int seed) Murmur3 32-bit variant.- Parameters:
data
- - input byte arraylength
- - length of arrayseed
- - seed. (default 0)- Returns:
- - hashcode
-
hash64
public static long hash64(byte[] data) Murmur3 64-bit variant. This is essentially MSB 8 bytes of Murmur3 128-bit variant.- Parameters:
data
- - input byte array- Returns:
- - hashcode
-
hash64
public static long hash64(byte[] data, int offset, int length) -
hash64
public static long hash64(byte[] data, int offset, int length, int seed) Murmur3 64-bit variant. This is essentially MSB 8 bytes of Murmur3 128-bit variant.- Parameters:
data
- - input byte arraylength
- - length of arrayseed
- - seed. (default is 0)- Returns:
- - hashcode
-
hash128
public static long[] hash128(byte[] data) Murmur3 128-bit variant.- Parameters:
data
- - input byte array- Returns:
- - hashcode (2 longs)
-
hash128
public static long[] hash128(byte[] data, int offset, int length, int seed) Murmur3 128-bit variant.- Parameters:
data
- - input byte arrayoffset
- - the first element of arraylength
- - length of arrayseed
- - seed. (default is 0)- Returns:
- - hashcode (2 longs)
-