krati.util
Class MurmurHashFunction
java.lang.Object
krati.util.MurmurHashFunction
- All Implemented Interfaces:
- HashFunction<byte[]>
public final class MurmurHashFunction
- extends Object
- implements HashFunction<byte[]>
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).
Method Summary |
long |
hash(byte[] buffer)
See hash(byte[] buffer, long initialValue) |
static int |
hash(byte[] data,
int seed)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MurmurHashFunction
public MurmurHashFunction()
hash
public static int hash(byte[] data,
int seed)
hash
public final long hash(byte[] buffer)
- See hash(byte[] buffer, long initialValue)
- Specified by:
hash
in interface HashFunction<byte[]>
- Parameters:
buffer
- Byte array that we are hashing on.
- Returns:
- Hash value for the buffer.
Copyright © 2011. All Rights Reserved.