Package gnu.kawa.util

Class HashUtils


  • public class HashUtils
    extends Object
    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 Detail

      • HashUtils

        public HashUtils()
    • Method Detail

      • boundedHash

        public static int boundedHash​(Object object)
      • boundedHash

        public static int boundedHash​(Object object,
                                      int seed,
                                      int limit)
        Generic hash method. See BoundedHashable for a discussion of the parameters.
      • hashInt

        public static int hashInt​(int seed,
                                  int value)
      • boundedHash

        public static int boundedHash​(List object,
                                      int seed,
                                      int limit)
      • boundedHashArray

        public static int boundedHashArray​(Object object,
                                           int seed,
                                           int limit)
      • boundedHash

        public static int boundedHash​(Array arr,
                                      int seed,
                                      int limit)
      • murmur3step

        public static int murmur3step​(int h1,
                                      int k1)
      • murmur3finish

        public static int murmur3finish​(int hash,
                                        int length)