Skip to main content

Module zlib

Module zlib 

Source
Expand description

zlib framing (RFC 1950): a two-byte header, raw DEFLATE, and an Adler-32 of the data.

This is also HTTP’s deflate content coding (RFC 9110 section 8.4.1.2).

use compress_lib::zlib;

let packed = zlib::compress(b"hello, hello, hello");
assert_eq!(zlib::decompress(&packed)?, b"hello, hello, hello");

Structs§

Decoder
A streaming zlib decoder.
Encoder
A streaming zlib encoder.

Functions§

compress
Compresses data into a complete zlib stream at level 6.
compress_with
Compresses data into a complete zlib stream at level.
decompress
Decompresses a complete zlib stream with the default Limits.
decompress_with
Decompresses a complete zlib stream with the given limits.