Package edu.berkeley.nlp.lm.util
Class MurmurHash
- java.lang.Object
-
- edu.berkeley.nlp.lm.util.MurmurHash
-
public final class MurmurHash extends java.lang.Object
Taken/modified from http://d3s.mff.cuni.cz/~holub/sw/javamurmurhash/MurmurHash.java
-
-
Constructor Summary
Constructors Constructor Description MurmurHash()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
hash32(int[] data, int startPos, int endPos)
static int
hash32(int[] data, int startPos, int endPos, int seed)
Generates 32 bit hash from byte array of the given length and seed.static long
hashOneLong(long k_, int seed)
static long
hashThreeLongs(long k1, long k2, long k3)
-
-
-
Method Detail
-
hash32
public static int hash32(int[] data, int startPos, int endPos, int seed)
Generates 32 bit hash from byte array of the given length and seed.- Parameters:
data
- int array to hashlength
- length of the array to hashseed
- initial seed value- Returns:
- 32 bit hash of the given array
-
hash32
public static int hash32(int[] data, int startPos, int endPos)
-
hashOneLong
public static long hashOneLong(long k_, int seed)
-
hashThreeLongs
public static long hashThreeLongs(long k1, long k2, long k3)
-
-