Class Murmur3HashFunction
- java.lang.Object
-
- org.hibernate.search.util.common.data.impl.Murmur3HashFunction
-
- All Implemented Interfaces:
HashFunction,RangeCompatibleHashFunction
public final class Murmur3HashFunction extends Object implements RangeCompatibleHashFunction
A fast, but cryptographically insecure hash function, implementing Murmur3.See MurmurHash3_x86_32 in the C++ implementation.
This function is more complex than
SimpleHashFunction, but is suitable for use inRangeHashTable, because it produces a more uniform hash distribution, even for datasets with very similar strings (same length, small character set, ...).MurmurHash3 was written by Austin Appleby, and is placed in the public domain. The author hereby disclaims copyright to this source code.
Original source code: http://code.google.com/p/smhasher/source/browse/trunk/MurmurHash3.cpp (Modified to adapt to Guava coding conventions and to use Guava's HashFunction interface, then modified again to adapt to Hibernate Search's coding conventions and to remove code that is unnecessary in Hibernate Search).
- Author:
- Austin Appleby, Dimitris Andreou, Kurt Alfred Kluever
-
-
Field Summary
Fields Modifier and Type Field Description static Murmur3HashFunctionINSTANCE
-
-
-
Field Detail
-
INSTANCE
public static final Murmur3HashFunction INSTANCE
-
-
Method Detail
-
hash
public int hash(CharSequence input)
Description copied from interface:HashFunctionHashes akey, i.e. turns it into an integer for use in aHashTable.- Specified by:
hashin interfaceHashFunction- Parameters:
input- A key to hash.- Returns:
- A hash.
-
-