Skip to main content

Module bytebuf

Module bytebuf 

Source
Expand description

Byte buffer and character buffer nodes.

Two composition patterns from nosqlbench:

  1. Direct hash fill: generate N bytes from a seed by chaining hashes. Fresh per cycle. Simple but slower for large buffers.

  2. Image extraction: pre-fill a large static buffer at init time, then extract variable-length slices at cycle time using hash-based offset selection. Fast hot path — just a memcpy.

Structs§

ByteImage
A pre-filled byte image for fast cycle-time extraction.
ByteImageExtract
Extract a fixed-size byte slice from a pre-built image.
ByteSlice
Extract a sub-range from a byte buffer.
BytesFromHash
Generate N deterministic bytes from a u64 seed via chained hashing. Each 8-byte chunk is hash(seed + chunk_index). Buffer is fresh per cycle.
CharImage
A pre-filled character image for fast text extraction.
CharImageExtract
Extract a text slice from a pre-built character image.
FromHex
Decode a hexadecimal string to bytes.
ToHex
Encode bytes as lowercase hexadecimal string.
U64ToBytes
Convert a u64 to 8 bytes (little-endian).