Standard library
gzip
gzip compress and decompress.
Introduction
gzip compress and decompress. Import std/compress/gzip to bind the module as gzip. Call free functions as gzip.name(...). Struct methods use a receiver value.
/ std/compress/gzip
This page is the package reference for std/compress/gzip. Private helpers used only by co-located tests are not listed.
Functions
Free functions on gzip. Each function has a short description, an example, then parameters and return shape.
compress
Compresses input to gzip bytes. Call form: gzip.compress(data).
/ std/compress/gzip
$ c = gzip.compress(b"hello")
Parameters: data: bytes or text to compress. Returns: Gzip-compressed bytes.
decompress
Decompresses gzip bytes. Call form: gzip.decompress(data).
/ std/compress/gzip
$ p = gzip.decompress(c)
Parameters: data: gzip bytes. Returns: Decompressed bytes.