Package org.drasyl.util
Class Murmur3
- java.lang.Object
-
- org.drasyl.util.Murmur3
-
public final class Murmur3 extends Object
This class contains methods for MurmurHash3 generation.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
murmur3_x86_32(byte[] data)
Generates a MurmurHash3 x86 32-bit hash without seed.static int
murmur3_x86_32(byte[] data, int seed)
Generates a MurmurHash3 x86 32-bit hash.static byte[]
murmur3_x86_32BytesLE(byte[] data)
Generates a MurmurHash3 x86 32-bit hash without seed with Little Endian Byte Order.static byte[]
murmur3_x86_32BytesLE(byte[] data, int seed)
Generates a MurmurHash3 x86 32-bit hash with Little Endian Byte Order.static int
murmur3_x86_32LE(byte[] data)
Generates a MurmurHash3 x86 32-bit hash without seed with Little Endian Byte Order.static int
murmur3_x86_32LE(byte[] data, int seed)
Generates a MurmurHash3 x86 32-bit hash with Little Endian Byte Order.
-
-
-
Method Detail
-
murmur3_x86_32
public static int murmur3_x86_32(byte[] data)
Generates a MurmurHash3 x86 32-bit hash without seed.- Parameters:
data
- the input to hash- Returns:
- the MurmurHash3 x86 32-bit hash
- Throws:
NullPointerException
- ifdata
isnull
-
murmur3_x86_32
public static int murmur3_x86_32(byte[] data, int seed)
Generates a MurmurHash3 x86 32-bit hash.This method is a Java port of the
MurmurHash3_x86_32
function from Austin Appleby.- Parameters:
data
- the input to hashseed
- the initial seed value- Returns:
- the MurmurHash3 x86 32-bit hash
- Throws:
NullPointerException
- ifdata
isnull
-
murmur3_x86_32LE
public static int murmur3_x86_32LE(byte[] data, int seed)
Generates a MurmurHash3 x86 32-bit hash with Little Endian Byte Order.- Parameters:
data
- the input to hashseed
- the initial seed value- Returns:
- the MurmurHash3 x86 32-bit hash
- Throws:
NullPointerException
- ifdata
isnull
-
murmur3_x86_32LE
public static int murmur3_x86_32LE(byte[] data)
Generates a MurmurHash3 x86 32-bit hash without seed with Little Endian Byte Order.- Parameters:
data
- the input to hash- Returns:
- the MurmurHash3 x86 32-bit hash
- Throws:
NullPointerException
- ifdata
isnull
-
murmur3_x86_32BytesLE
public static byte[] murmur3_x86_32BytesLE(byte[] data, int seed)
Generates a MurmurHash3 x86 32-bit hash with Little Endian Byte Order.- Parameters:
data
- the input to hashseed
- the initial seed value- Returns:
- the MurmurHash3 x86 32-bit hash
- Throws:
NullPointerException
- ifdata
isnull
-
murmur3_x86_32BytesLE
public static byte[] murmur3_x86_32BytesLE(byte[] data)
Generates a MurmurHash3 x86 32-bit hash without seed with Little Endian Byte Order.- Parameters:
data
- the input to hash- Returns:
- the MurmurHash3 x86 32-bit hash
- Throws:
NullPointerException
- ifdata
isnull
-
-