Package 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
Description
`XxHash()`

## Method Summary

Modifier and Type
Method
Description
`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

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

## Constructor Details

### XxHash

public XxHash()

## Method Details

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