std/deflate
Pure-Milo DEFLATE compression (RFC 1951) plus the gzip (RFC 1952) and zlib (RFC 1950) container framings. No external codec dependency. Decompress with std/inflate.
milo
from "std/deflate" import { Deflate }Example
milo
from "std/inflate" import { Inflate }
let gz = Deflate.gzip("hello, hello, hello")
let back = Inflate.gzip(gz)! // "hello, hello, hello"API reference
BitW
milo
pub struct BitWFields:
acc: i64: bits accumulated for the current byte (LSB-first)nbits: i64: how many bits are in acc (0..7)out: string
Deflate
milo
pub struct DeflateDeflate namespace — Deflate.raw (raw deflate), .gzip, .zlib compressors.
Deflate.gzip
milo
fn Deflate.gzip(src: &string): stringCompress to a gzip stream: 10-byte header, DEFLATE body, CRC-32 + length trailer.
Deflate.raw
milo
fn Deflate.raw(src: &string): stringCompress to a single fixed-Huffman DEFLATE stream (no container header).
Deflate.zlib
milo
fn Deflate.zlib(src: &string): stringCompress to a zlib stream: 2-byte header, DEFLATE body, Adler-32 trailer.