silk.compress.zstd_checksum.

Incremental seed-zero XXH64 state for zstd frame checksums.

Details#

Xxh64.make creates fixed storage. Xxh64.updateByte and Xxh64.update accept bytes, and Xxh64.finish returns the complete hash without changing the state. Frames store its low 32 bits.

Import as Xxh64 with import silk.compress.zstd_checksum { Xxh64 }.

Public declarations: 1.

Xxh64#

silk
pub struct Xxh64

An allocation-free seed-zero checksum state with a 32-byte partial stripe.

Implementation Xxh64#

silk
impl Xxh64

Associated function make#

silk
pub fn make() -> Xxh64

Creates an empty seed-zero checksum state without allocating storage.

Method updateByte#

silk
pub fn updateByte(self: &mut Self, value: u8) -> ()

Adds one decoded byte without allocating storage.

Gotchas#

The caller must reject input that would make the total byte count exceed u64.MAX.

Method update#

silk
pub fn update(self: &mut Self, bytes: &[u8]) -> ()

Adds a run of bytes without allocating storage.

Gotchas#

The caller must reject input that would make the total byte count exceed u64.MAX.

Method finish#

silk
pub fn finish(self: &Self) -> u64

Returns the seed-zero XXH64 digest without changing or consuming the state.

Category: Data formats.

Profiles: aarch64-apple-darwin, aarch64-unknown-linux-gnu, aarch64-unknown-linux-gnu-no-libc, x86_64-unknown-linux-gnu, x86_64-unknown-linux-gnu-no-libc, wasm32-unknown-unknown, wasm32-wasip1, wasm32-wasip2, x86_64-pc-windows-msvc, wasm64-unknown-unknown.

View the source of this page