Crate gzip_header[][src]

Expand description

A library to decode and encode headers for the gzip format. The library also contains a reader absctraction over a CRC checksum hasher.

A file in the gzip format contains a gzip header, a number of compressed data blocks in the DEFLATE format, and ends with the CRC32-checksum (in the IEEE format) and number of bytes (modulo 2^32) of the uncompressed data.

The gzip header is purely a set of metadata, and doesn’t have any impact on the decoding of the compressed data other than the fact that DEFLATE-encoded data with a gzip-header is checked using the CRC32 algorithm.

This library is based on the gzip header functionality in the flate2 crate.


A wrapper struct containing a CRC checksum in the format used by gzip and the amount of bytes input to it mod 2^32.

A reader that updates the checksum and counter of a Crc struct when reading from the wrapped reader.

A builder structure to create a new gzip header.

A structure representing the raw header of a gzip stream.


Valid values for the extra flag in the gzip specification.

An enum describing the different OS types described in the gzip format. See (Additionally, the Apple(19) value is defined in the zlib library).


Try to read a gzip header from the provided reader.