Package org.apache.lucene.codecs.bloom
Class MurmurHash64
java.lang.Object
org.apache.lucene.codecs.bloom.HashFunction
org.apache.lucene.codecs.bloom.MurmurHash64
This is a very fast, non-cryptographic hash suitable for general hash-based lookup. See
http://murmurhash.googlepages.com/ for more details.
The code from Apache Commons was adapted in the form here to work with BytesRefs with offsets and lengths rather than raw byte arrays.
-
Field Summary
-
Constructor Summary
-
Method Summary
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
MurmurHash64
public MurmurHash64()
-
-
Method Details
-
hash64
public static long hash64(byte[] data, int seed, int offset, int length) Generates a 64-bit hash from byte array of the given length and seed.- Parameters:
data
- The input byte arrayseed
- The initial seed valuelength
- The length of the array- Returns:
- The 64-bit hash of the given array
-
hash
Description copied from class:HashFunction
Hashes the contents of the referenced bytes- Specified by:
hash
in classHashFunction
- Parameters:
br
- the data to be hashed- Returns:
- the hash of the bytes referenced by bytes.offset and length bytes.length
-
toString
-