Package org.opensearch.common.hash
Class T1ha1
java.lang.Object
org.opensearch.common.hash.T1ha1
t1ha: Fast Positive Hash
Implements t1ha1; a fast portable hash function with reasonable quality for checksums, hash tables, and thin fingerprinting.
To overcome language and performance limitations, this implementation differs slightly from the reference implementation in C++, so the returned values may vary before JDK 18.
Intended for little-endian systems but returns the same result on big-endian, albeit marginally slower.
- Opensearch.internal:
-
Method Summary
-
Method Details
-
hash
public static long hash(byte[] input, int offset, int length) Returns the hash code for the specified range of the givenbytearray.- Parameters:
input- the input byte arrayoffset- the starting offsetlength- the length of the range- Returns:
- hash code
-
hash
public static long hash(byte[] input, int offset, int length, long seed) Returns the hash code for the specified range of the givenbytearray.- Parameters:
input- the input byte arrayoffset- the starting offsetlength- the length of the rangeseed- customized seed- Returns:
- hash code
-