|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.codecs.bloom.HashFunction org.apache.lucene.codecs.bloom.MurmurHash2
public final class MurmurHash2
This is a very fast, non-cryptographic hash suitable for general hash-based lookup. See http://murmurhash.googlepages.com/ for more details.
The C version of MurmurHash 2.0 found at that site was ported to Java by Andrzej Bialecki (ab at getopt org).
The code from getopt.org was adapted by Mark Harwood in the form here as one of a pluggable choice of hashing functions as the core function had to be adapted to work with BytesRefs with offsets and lengths rather than raw byte arrays.
Field Summary | |
---|---|
static MurmurHash2 |
INSTANCE
|
Method Summary | |
---|---|
static int |
hash(byte[] data,
int seed,
int offset,
int len)
|
int |
hash(BytesRef br)
Hashes the contents of the referenced bytes |
static int |
hash32(byte[] data,
int offset,
int len)
Generates 32 bit hash from byte array with default seed value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final MurmurHash2 INSTANCE
Method Detail |
---|
public static int hash(byte[] data, int seed, int offset, int len)
public static final int hash32(byte[] data, int offset, int len)
data
- byte array to hashoffset
- the start position in the array to hashlen
- length of the array elements to hash
public final int hash(BytesRef br)
HashFunction
hash
in class HashFunction
br
- the data to be hashed
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |