org.apache.datasketches.hash

## Class XxHash

- java.lang.Object
- - org.apache.datasketches.hash.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 Summary

Constructors
Constructor and Description
`XxHash()`

### Method Summary

All Methods Static Methods Concrete Methods
`static long` `hash(long in, long seed)` Returns a 64-bit hash.
`static long` `hash(org.apache.datasketches.memory.Memory mem, long offsetBytes, long lengthBytes, long seed)` Compute the hash of the given Memory object.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### 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