Class XxHash

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static long hashBooleanArr​(boolean[] arr, long offsetBooleans, long lengthBooleans, long seed)
      Hash the given arr starting at the given offset and continuing for the given length using the given seed.
      static long hashByteArr​(byte[] arr, long offsetBytes, long lengthBytes, long seed)
      Hash the given arr starting at the given offset and continuing for the given length using the given seed.
      static long hashCharArr​(char[] arr, long offsetChars, long lengthChars, long seed)
      Hash the given arr starting at the given offset and continuing for the given length using the given seed.
      static long hashDoubleArr​(double[] arr, long offsetDoubles, long lengthDoubles, long seed)
      Hash the given arr starting at the given offset and continuing for the given length using the given seed.
      static long hashFloatArr​(float[] arr, long offsetFloats, long lengthFloats, long seed)
      Hash the given arr starting at the given offset and continuing for the given length using the given seed.
      static long hashIntArr​(int[] arr, long offsetInts, long lengthInts, long seed)
      Hash the given arr starting at the given offset and continuing for the given length using the given seed.
      static long hashLong​(long in, long seed)
      Returns a 64-bit hash from a single long.
      static long hashLongArr​(long[] arr, long offsetLongs, long lengthLongs, long seed)
      Hash the given arr starting at the given offset and continuing for the given length using the given seed.
      static long hashShortArr​(short[] arr, long offsetShorts, long lengthShorts, long seed)
      Hash the given arr starting at the given offset and continuing for the given length using the given seed.
      static long hashString​(String str, long offsetChars, long lengthChars, long seed)
      Hash the given arr starting at the given offset and continuing for the given length using the given seed.
    • Method Detail

      • hashBooleanArr

        public static long hashBooleanArr​(boolean[] arr,
                                          long offsetBooleans,
                                          long lengthBooleans,
                                          long seed)
        Hash the given arr starting at the given offset and continuing for the given length using the given seed.
        Parameters:
        arr - the given array
        offsetBooleans - starting at this offset
        lengthBooleans - continuing for this length
        seed - the given seed
        Returns:
        the hash
      • hashByteArr

        public static long hashByteArr​(byte[] arr,
                                       long offsetBytes,
                                       long lengthBytes,
                                       long seed)
        Hash the given arr starting at the given offset and continuing for the given length using the given seed.
        Parameters:
        arr - the given array
        offsetBytes - starting at this offset
        lengthBytes - continuing for this length
        seed - the given seed
        Returns:
        the hash
      • hashShortArr

        public static long hashShortArr​(short[] arr,
                                        long offsetShorts,
                                        long lengthShorts,
                                        long seed)
        Hash the given arr starting at the given offset and continuing for the given length using the given seed.
        Parameters:
        arr - the given array
        offsetShorts - starting at this offset
        lengthShorts - continuing for this length
        seed - the given seed
        Returns:
        the hash
      • hashCharArr

        public static long hashCharArr​(char[] arr,
                                       long offsetChars,
                                       long lengthChars,
                                       long seed)
        Hash the given arr starting at the given offset and continuing for the given length using the given seed.
        Parameters:
        arr - the given array
        offsetChars - starting at this offset
        lengthChars - continuing for this length
        seed - the given seed
        Returns:
        the hash
      • hashIntArr

        public static long hashIntArr​(int[] arr,
                                      long offsetInts,
                                      long lengthInts,
                                      long seed)
        Hash the given arr starting at the given offset and continuing for the given length using the given seed.
        Parameters:
        arr - the given array
        offsetInts - starting at this offset
        lengthInts - continuing for this length
        seed - the given seed
        Returns:
        the hash
      • hashLongArr

        public static long hashLongArr​(long[] arr,
                                       long offsetLongs,
                                       long lengthLongs,
                                       long seed)
        Hash the given arr starting at the given offset and continuing for the given length using the given seed.
        Parameters:
        arr - the given array
        offsetLongs - starting at this offset
        lengthLongs - continuing for this length
        seed - the given seed
        Returns:
        the hash
      • hashLong

        public static long hashLong​(long in,
                                    long seed)
        Returns a 64-bit hash from a single long. This method has been optimized for speed when only a single hash of a long is required.
        Parameters:
        in - A long.
        seed - A long valued seed.
        Returns:
        the hash.
      • hashFloatArr

        public static long hashFloatArr​(float[] arr,
                                        long offsetFloats,
                                        long lengthFloats,
                                        long seed)
        Hash the given arr starting at the given offset and continuing for the given length using the given seed.
        Parameters:
        arr - the given array
        offsetFloats - starting at this offset
        lengthFloats - continuing for this length
        seed - the given seed
        Returns:
        the hash
      • hashDoubleArr

        public static long hashDoubleArr​(double[] arr,
                                         long offsetDoubles,
                                         long lengthDoubles,
                                         long seed)
        Hash the given arr starting at the given offset and continuing for the given length using the given seed.
        Parameters:
        arr - the given array
        offsetDoubles - starting at this offset
        lengthDoubles - continuing for this length
        seed - the given seed
        Returns:
        the hash
      • hashString

        public static long hashString​(String str,
                                      long offsetChars,
                                      long lengthChars,
                                      long seed)
        Hash the given arr starting at the given offset and continuing for the given length using the given seed.
        Parameters:
        str - the given string
        offsetChars - starting at this offset
        lengthChars - continuing for this length
        seed - the given seed
        Returns:
        the hash