Class Murmur3_32HashFunction

    • Constructor Detail

      • Murmur3_32HashFunction

        Murmur3_32HashFunction​(int seed)
    • Method Detail

      • bits

        public int bits()
        Description copied from interface: HashFunction
        Returns the number of bits (a multiple of 32) that each hash code produced by this hash function has.
        Specified by:
        bits in interface HashFunction
      • newHasher

        public Hasher newHasher()
        Description copied from interface: HashFunction
        Begins a new hash code computation by returning an initialized, stateful Hasher instance that is ready to receive data. Example:
           
        
           HashFunction hf = Hashing.md5();
           HashCode hc = hf.newHasher()
               .putLong(id)
               .putBoolean(isActive)
               .hash();
        Specified by:
        newHasher in interface HashFunction
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(@Nullable
                              java.lang.Object object)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • hashInt

        public HashCode hashInt​(int input)
        Description copied from interface: HashFunction
        Shortcut for newHasher().putInt(input).hash(); returns the hash code for the given int value, interpreted in little-endian byte order. The implementation might perform better than its longhand equivalent, but should not perform worse.
        Specified by:
        hashInt in interface HashFunction
        Overrides:
        hashInt in class AbstractStreamingHashFunction
      • hashLong

        public HashCode hashLong​(long input)
        Description copied from interface: HashFunction
        Shortcut for newHasher().putLong(input).hash(); returns the hash code for the given long value, interpreted in little-endian byte order. The implementation might perform better than its longhand equivalent, but should not perform worse.
        Specified by:
        hashLong in interface HashFunction
        Overrides:
        hashLong in class AbstractStreamingHashFunction
      • hashUnencodedChars

        public HashCode hashUnencodedChars​(java.lang.CharSequence input)
        Description copied from interface: HashFunction
        Shortcut for newHasher().putUnencodedChars(input).hash(). The implementation might perform better than its longhand equivalent, but should not perform worse. Note that no character encoding is performed; the low byte and high byte of each char are hashed directly (in that order).

        Warning: This method will produce different output than most other languages do when running the same hash function on the equivalent input. For cross-language compatibility, use HashFunction.hashString(java.lang.CharSequence, java.nio.charset.Charset), usually with a charset of UTF-8. For other use cases, use hashUnencodedChars.

        Specified by:
        hashUnencodedChars in interface HashFunction
        Overrides:
        hashUnencodedChars in class AbstractStreamingHashFunction
      • mixK1

        private static int mixK1​(int k1)
      • mixH1

        private static int mixH1​(int h1,
                                 int k1)
      • fmix

        private static HashCode fmix​(int h1,
                                     int length)