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.net.openhft.chronicle.core.io.ClosedIllegalStateException
- If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException
- If this resource was accessed by multiple threads in an unsafe waypublic 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.BufferUnderflowException
- If there is not enough data.net.openhft.chronicle.core.io.ClosedIllegalStateException
- If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException
- If this resource was accessed by multiple threads in an unsafe wayIllegalStateException
Copyright © 2024. All rights reserved.