|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.infinispan.util.hash.MurmurHash2Compat
public class MurmurHash2Compat
An implementation of Austin Appleby's MurmurHash2.0 algorithm, as documented on his website.
This implementation is based on the slower, endian-neutral version of the algorithm as documented on the site, ported from Austin Appleby's original C++ version MurmurHashNeutral2.cpp. Other implementations are documented on Wikipedia's MurmurHash page. Note: This is the backward compatible version of this hash. The correct version of this hash is implemented asMurmurHash2
. This version contains a slight bug in that it only takes into account 31 bits of the 32 bit range,
which will result in poorer distribution. It is still maintained in the source tree to provide backward compatibility
with existing clusters prior to 4.2.1, when the bug was identified and fixed. See ISPN-873 for more details.
MurmurHash2
Constructor Summary | |
---|---|
MurmurHash2Compat()
|
Method Summary | |
---|---|
int |
hash(byte[] payload)
Hashes a byte array efficiently. |
int |
hash(int hashcode)
An incremental version of the hash function, that spreads a pre-calculated hash code, such as one derived from Object.hashCode() . |
int |
hash(Object o)
A helper that calculates the hashcode of an object, choosing the optimal mechanism of hash calculation after considering the type of the object (byte array, String or Object). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MurmurHash2Compat()
Method Detail |
---|
public final int hash(byte[] payload)
Hash
hash
in interface Hash
payload
- a byte array to hash
public final int hash(int hashcode)
Hash
Object.hashCode()
.
hash
in interface Hash
hashcode
- an object's hashcode
public final int hash(Object o)
Hash
hash
in interface Hash
o
- object to hash
|
--> | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |