Class XxHash


  • public class XxHash
    extends Object
    The XxHash is a fast, non-cryptographic, 64-bit hash function that has excellent avalanche and 2-way bit independence properties.

    This class wraps the Memory Component XxHash implementation.

    Author:
    Lee Rhodes
    • Constructor Detail

      • XxHash

        public XxHash()
    • Method Detail

      • hash

        public static long hash​(org.apache.datasketches.memory.Memory mem,
                                long offsetBytes,
                                long lengthBytes,
                                long seed)
        Compute the hash of the given Memory object.
        Parameters:
        mem - The given Memory object
        offsetBytes - Starting at this offset in bytes
        lengthBytes - Continuing for this number of bytes
        seed - use this seed for the hash function
        Returns:
        return the resulting 64-bit hash value.
      • hash

        public static long hash​(long in,
                                long seed)
        Returns a 64-bit hash.
        Parameters:
        in - a long
        seed - A long valued seed.
        Returns:
        the hash