edu.berkeley.nlp.lm.util
Class MurmurHash
java.lang.Object
edu.berkeley.nlp.lm.util.MurmurHash
public final class MurmurHash
- extends Object
Taken/modified from
http://d3s.mff.cuni.cz/~holub/sw/javamurmurhash/MurmurHash.java
Method Summary |
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)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MurmurHash
public MurmurHash()
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)