Module swim.util
Package swim.util

Class Murmur3


  • public final class Murmur3
    extends Object
    32-bit MurmurHash algorithm, version 3.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int hash​(boolean value)
      Returns the hash code of the primitive `boolean` `value`.
      static int hash​(byte value)
      Returns the hash code of the primitive `byte` `value`.
      static int hash​(char value)
      Returns the hash code of the primitive `char` `value`.
      static int hash​(double value)
      Returns the hash code of the primitive `double` `value`.
      static int hash​(float value)
      Returns the hash code of the primitive `float` `value`.
      static int hash​(int value)
      Returns the hash code of the primitive `int` `value`.
      static int hash​(long value)
      Returns the hash code of the primitive `long` `value`.
      static int hash​(short value)
      Returns the hash code of the primitive `short` `value`.
      static int hash​(Number number)
      Returns the hash code of the number.
      static int hash​(Object object)
      Returns the hash code of the–possibly nullobject.
      static int mash​(int code)
      Finalizes a hash code.
      static int mix​(int code, byte[] array)
      Mixes each consecutive 4-byte word in the array into the accumulated hash code.
      static int mix​(int code, byte[] array, int offset, int size)
      Mixes each consecutive 4-byte word in the array, starting at index offset, and continuing for size bytes, into the accumulated hash code.
      static int mix​(int code, int value)
      Mixes a new hash value into the accumulated cumulative hash code.
      static int mix​(int code, String string)
      Mixes each consecutive 4-byte word in the UTF-8 encoding of the string into the accumulated hash code.
      static int seed​(Class<?> clazz)
      Returns the hash code of the name of the class.
      static int seed​(String string)
      Returns the hash code of the string.
    • Method Detail

      • seed

        public static int seed​(Class<?> clazz)
        Returns the hash code of the name of the class.
      • seed

        public static int seed​(String string)
        Returns the hash code of the string.
      • hash

        public static int hash​(byte value)
        Returns the hash code of the primitive `byte` `value`.
      • hash

        public static int hash​(short value)
        Returns the hash code of the primitive `short` `value`.
      • hash

        public static int hash​(int value)
        Returns the hash code of the primitive `int` `value`.
      • hash

        public static int hash​(long value)
        Returns the hash code of the primitive `long` `value`.
      • hash

        public static int hash​(float value)
        Returns the hash code of the primitive `float` `value`.
      • hash

        public static int hash​(double value)
        Returns the hash code of the primitive `double` `value`.
      • hash

        public static int hash​(char value)
        Returns the hash code of the primitive `char` `value`.
      • hash

        public static int hash​(boolean value)
        Returns the hash code of the primitive `boolean` `value`.
      • hash

        public static int hash​(Number number)
        Returns the hash code of the number.
      • hash

        public static int hash​(Object object)
        Returns the hash code of the–possibly nullobject.
      • mix

        public static int mix​(int code,
                              byte[] array,
                              int offset,
                              int size)
        Mixes each consecutive 4-byte word in the array, starting at index offset, and continuing for size bytes, into the accumulated hash code.
      • mix

        public static int mix​(int code,
                              byte[] array)
        Mixes each consecutive 4-byte word in the array into the accumulated hash code.
      • mix

        public static int mix​(int code,
                              String string)
        Mixes each consecutive 4-byte word in the UTF-8 encoding of the string into the accumulated hash code.
      • mix

        public static int mix​(int code,
                              int value)
        Mixes a new hash value into the accumulated cumulative hash code.
      • mash

        public static int mash​(int code)
        Finalizes a hash code.