Package gnu.kawa.util
Class HashUtils
java.lang.Object
gnu.kawa.util.HashUtils
Various static helper methods for calculating hash-codes.
These are designed to tolerate cyclic data structrues, by using
a recursive/iteration limit.
The actual hash functions used (unless we fall back to Object#hashCode)
is the MurmurHash3 algorithm:
http://en.wikipedia.org/wiki/MurmurHash
https://code.google.com/p/smhasher/wiki/MurmurHash3
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intboundedHash(Array arr, int seed, int limit) static intboundedHash(Object object) static intboundedHash(Object object, int seed, int limit) Generic hash method.static intboundedHash(List object, int seed, int limit) static intboundedHashArray(Object object, int seed, int limit) static inthashInt(int seed, int value) static intmurmur3finish(int hash, int length) static intmurmur3step(int h1, int k1)
-
Constructor Details
-
HashUtils
public HashUtils()
-
-
Method Details
-
boundedHash
-
boundedHash
Generic hash method. See BoundedHashable for a discussion of the parameters. -
hashInt
public static int hashInt(int seed, int value) -
boundedHash
-
boundedHashArray
-
boundedHash
-
murmur3step
public static int murmur3step(int h1, int k1) -
murmur3finish
public static int murmur3finish(int hash, int length)
-