public class XxHash extends Object implements BytesStoreHash<BytesStore>
Migrated from Zero-Allocation-Hashing.
BytesStoreHash
,
BytesStore
Modifier and Type | Field and Description |
---|---|
static XxHash |
INSTANCE
Singleton instance of XxHash with seed P4.
|
Constructor and Description |
---|
XxHash(long seed)
Constructs a new instance of XxHash with the specified seed.
|
Modifier and Type | Method and Description |
---|---|
long |
applyAsLong(BytesStore bytes)
Calculates the hash code of the given byte store.
|
long |
applyAsLong(BytesStore bytes,
long length)
Computes a hash value for the given byte store with a specified length.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
hash, hash, hash32, hash32
public static final XxHash INSTANCE
public XxHash(long seed)
seed
- the seed for hash computation.public long applyAsLong(BytesStore bytes)
applyAsLong
in interface ToLongFunction<BytesStore>
bytes
- the byte store to be hashed.AssertionError
- if there is an issue with reading data from the byte store.public long applyAsLong(BytesStore bytes, long length) throws IllegalStateException, BufferUnderflowException
applyAsLong
in interface BytesStoreHash<BytesStore>
bytes
- the byte store.length
- the number of bytes to hash.IllegalStateException
- If the state is illegal.BufferUnderflowException
- If there is not enough data.Copyright © 2023. All rights reserved.