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
All Methods Static Methods Concrete Methods Modifier and Type Method Description static longhash(long in, long seed)Returns a 64-bit hash.static longhash(org.apache.datasketches.memory.Memory mem, long offsetBytes, long lengthBytes, long seed)Compute the hash of the given Memory object.
-
-
-
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 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
-
-