Expand description
Self-describing envelope used by quantization codecs that persist their calibrated parameters (BBQ, RaBitQ, …).
Wire layout: magic (5 bytes) + version (1 byte) + MessagePack body
produced by zerompk. Codecs choose their own 5-byte magic (e.g.
b"NDBBQ", b"NDRBQ") so a mismatched buffer fails fast with a typed
CodecError instead of an opaque MessagePack decode error.
Constants§
- HEADER_
LEN - Total length of the envelope header (
magic+version). - MAGIC_
LEN - Length of the magic prefix.
Functions§
- decode
- Validate the envelope header and deserialize the body into
T. - encode
- Serialize
valueinto a versioned, magic-tagged byte buffer. - peek_
version - Read the version byte without decoding the body. Returns
Noneif the buffer is too short or the magic does not match.