This library is in flux. APIs may change without notice. Generated from source with koruc 0.1.7 on 11/4/2026.

Compress

import std/compress

std/compress - owned gzip encoding: pure Zig, no libc, freestanding-safe.

compress.kz · 2 tors

std/compress - owned gzip encoding: pure Zig, no libc, freestanding-safe. One-shot gzip for bodies of any size: input chunks at FF_BLOCK_CAP (65535 bytes — the ff_tok capacity bound) into a multi-block DEFLATE stream, absolute positions keeping the 32KB match window live across block boundaries. Dynamic Huffman with a per-worker cached tree reused while a used-symbol mask stays inside the tree's coverage; fixed Huffman below 64 bytes where the tree header costs more than it saves. The trailer folds through PMULL on aarch64-crypto targets, PCLMULQDQ on x86_64 where CPUID reports it, and a slicing-by-8 table elsewhere. const n = std_compress.gzipInto(body, out_buf); if (n == 0) // out buffer too small

Phantom lifecycles

Derived from the phantom labels in the declarations below — state! issues an obligation the compiler will chase, !state discharges it, a bare state holds it without moving it. Nothing here is hand-drawn.

string carries the label <*> with no obligation attached — a dimension, not a lifecycle.