Esc

deflate_sync

procedureextensionsince 0.36.1Source
  • macOS: deflate_sync works on macOS
  • Linux: deflate_sync works on Linux
  • Windows: deflate_sync works on Windows
  • Wasm: deflate_sync works on Wasm

Encodes a raw DEFLATE message ending at Z_SYNC_FLUSH, with the four-byte tail omitted. A borrowed dictionary seeds compression history; only its last 2 ^ window_bits bytes are used, and no match reaches farther back than that (8 to 15, the window a peer's inflate_sync is given). Example: packed := deflate_sync(cast([] u8) "hello"); free(packed.data).

Signature

deflate_sync :: (
    data: [] u8,
    level: s32 = 6,
    dictionary: [] u8 = .[],
    window_bits: int = 15
) -> [] u8

See also