Package org.apache.datasketches.hash
Class XxHash
java.lang.Object
org.apache.datasketches.hash.XxHash
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
-
Method Summary
-
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 objectoffsetBytes
- Starting at this offset in byteslengthBytes
- Continuing for this number of bytesseed
- 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 longseed
- A long valued seed.- Returns:
- the hash
-