Package com.gengoai.math
Class HashingFunctions
- java.lang.Object
-
- com.gengoai.math.HashingFunctions
-
public class HashingFunctions extends Object
Taken from commons-codec MurmurHash3.java
-
-
Constructor Summary
Constructors Constructor Description HashingFunctions()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
hash32x86(byte[] data)
Generates 32-bit hash from the byte array with a seed of zero.static int
hash32x86(byte[] data, int offset, int length, int seed)
Generates 32-bit hash from the byte array with the given offset, length and seed.
-
-
-
Method Detail
-
hash32x86
public static int hash32x86(byte[] data)
Generates 32-bit hash from the byte array with a seed of zero. This is a helper method that will produce the same result as:int offset = 0; int seed = 0; int hash = MurmurHash3.hash32x86(data, offset, data.length, seed);
- Parameters:
data
- The input byte array- Returns:
- The 32-bit hash
- Since:
- 1.14
- See Also:
hash32x86(byte[], int, int, int)
-
hash32x86
public static int hash32x86(byte[] data, int offset, int length, int seed)
Generates 32-bit hash from the byte array with the given offset, length and seed.This is an implementation of the 32-bit hash function
MurmurHash3_x86_32
from from Austin Applyby's original MurmurHash3c++
code in SMHasher.- Parameters:
data
- The input byte arrayoffset
- The offset of datalength
- The length of arrayseed
- The initial seed value- Returns:
- The 32-bit hash
- Since:
- 1.14
-
-