class Hasher ulong digest = Sz.Hash(data, seed: 42);
using Hasher hasher = new(seed: 42); // streaming
hasher.Update(firstChunk);
hasher.Update(secondChunk);
ulong streamed = hasher.Digest();
byte[] sha = Sha256.HashData(data); // cf. System.Security.Cryptography.SHA256API
ClassHasherIncremental (streaming) StringZilla hash. Dispose to free the native state.4
HasherAllocates and initializes the native hash state with the given seed .
Hasher(ulong seed = 0); *Update× 2Feeds data into the hash.
void Update(ReadOnlySpan<byte> data); Throws ObjectDisposedException after disposal.
DigestFinalize without mutating state (may be called repeatedly).
ulong Digest(); *Dispose× 2Frees the native hash state; calling it again does nothing.
void Dispose(); ClassSha256Incremental SHA-256.3
class Sha256 Dispose to free the native state.
Equivalent to System.Security.Cryptography.IncrementalHash with SHA-256, SIMD-accelerated. One-shot: HashData.
Sha256
Sha256(); DigestWrites the 32-byte digest into destination (must be ≥ 32 bytes; non-mutating, may be called repeatedly).
void Digest(Span<byte> destination); byte[] Digest(); Finalize into a fresh 32-byte digest (non-mutating; may be called repeatedly).
Allocation-free.
HashDataOne-shot SHA-256 of data → 32-byte digest.
byte[] HashData(ReadOnlySpan<byte> data); Equivalent to System.Security.Cryptography.SHA256.HashData(System.ReadOnlySpan<byte>).