Package org.drasyl.util
Class Murmur3
java.lang.Object
org.drasyl.util.Murmur3
This class contains methods for MurmurHash3 generation.
-
Method Summary
Modifier and TypeMethodDescriptionstatic intmurmur3_x86_32(byte[] data) Generates a MurmurHash3 x86 32-bit hash without seed.static intmurmur3_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 intmurmur3_x86_32LE(byte[] data) Generates a MurmurHash3 x86 32-bit hash without seed with Little Endian Byte Order.static intmurmur3_x86_32LE(byte[] data, int seed) Generates a MurmurHash3 x86 32-bit hash with Little Endian Byte Order.
-
Method Details
-
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- ifdataisnull
-
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_32function from Austin Appleby.- Parameters:
data- the input to hashseed- the initial seed value- Returns:
- the MurmurHash3 x86 32-bit hash
- Throws:
NullPointerException- ifdataisnull
-
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- ifdataisnull
-
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- ifdataisnull
-
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- ifdataisnull
-
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- ifdataisnull
-