B - the type of BytesStore that this function can compute hash values for.public interface BytesStoreHash<B extends BytesStore> extends ToLongFunction<B>
BytesStore.
Implementations provide fast, deterministic hashing based on little-endian
variants of the Murmur3 algorithm.
This interface also exposes static helpers for computing 32-bit and 64-bit
hashes using the bundled implementations.
Implementations should avoid allocating memory and may assume that
length bytes can be read without extra bounds checks.
See algo-overview.adoc for usage examples.
| Modifier and Type | Method and Description |
|---|---|
long |
applyAsLong(BytesStore<?,?> bytes,
long length)
Computes a 64-bit hash value of the given
BytesStore with a specified length. |
static long |
hash(@NotNull BytesStore<?,?> b)
Computes a 64-bit hash value of the given
BytesStore. |
static long |
hash(@NotNull BytesStore<?,?> b,
long length)
Computes a 64-bit hash value of the given
BytesStore with a specified length. |
static int |
hash32(BytesStore<?,?> b)
Computes a 32-bit hash value of the given
BytesStore. |
static int |
hash32(@NotNull BytesStore<?,?> b,
int length)
Computes a 32-bit hash value of the given
BytesStore with a specified length. |
applyAsLongstatic long hash(@NotNull
@NotNull BytesStore<?,?> b)
BytesStore.b - the BytesStore to compute the hash for.net.openhft.chronicle.core.io.ClosedIllegalStateException - if the resource has been released or closednet.openhft.chronicle.core.io.ThreadingIllegalStateException - if this resource was accessed by multiple threads in an unsafe waystatic long hash(@NotNull
@NotNull BytesStore<?,?> b,
long length)
throws IllegalStateException,
BufferUnderflowException
BytesStore with a specified length.b - the BytesStore to compute the hash for.length - the number of bytes to include in the hash computation.BufferUnderflowException - if the length specified is greater than the available bytesnet.openhft.chronicle.core.io.ClosedIllegalStateException - if the resource has been released or closednet.openhft.chronicle.core.io.ThreadingIllegalStateException - if this resource was accessed by multiple threads in an unsafe wayIllegalStateExceptionstatic int hash32(BytesStore<?,?> b)
BytesStore.b - the BytesStore to compute the hash for.net.openhft.chronicle.core.io.ClosedIllegalStateException - if the resource has been released or closednet.openhft.chronicle.core.io.ThreadingIllegalStateException - if this resource was accessed by multiple threads in an unsafe waystatic int hash32(@NotNull
@NotNull BytesStore<?,?> b,
int length)
throws IllegalStateException,
BufferUnderflowException
BytesStore with a specified length.b - the BytesStore to compute the hash for.length - the number of bytes to include in the hash computation.BufferUnderflowException - if the length specified is greater than the available bytesnet.openhft.chronicle.core.io.ClosedIllegalStateException - if the resource has been released or closednet.openhft.chronicle.core.io.ThreadingIllegalStateException - if this resource was accessed by multiple threads in an unsafe wayIllegalStateExceptionlong applyAsLong(BytesStore<?,?> bytes, long length) throws IllegalStateException, BufferUnderflowException
BytesStore with a specified length.bytes - the BytesStore to compute the hash for.length - the number of bytes to include in the hash computation.BufferUnderflowException - if the length specified is greater than the available bytesnet.openhft.chronicle.core.io.ClosedIllegalStateException - if the resource has been released or closednet.openhft.chronicle.core.io.ThreadingIllegalStateException - if this resource was accessed by multiple threads in an unsafe way
Implementations are typically branch-free and perform no allocations.
IllegalStateExceptionCopyright © 2026 Chronicle Software Ltd. All rights reserved.