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 int
boundedHash
(Array arr, int seed, int limit) static int
boundedHash
(Object object) static int
boundedHash
(Object object, int seed, int limit) Generic hash method.static int
boundedHash
(List object, int seed, int limit) static int
boundedHashArray
(Object object, int seed, int limit) static int
hashInt
(int seed, int value) static int
murmur3finish
(int hash, int length) static int
murmur3step
(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)
-