gzip

Gzip Format (Stored Blocks Only)

Functions

FunctionDescription
_gz_byte_atInternal byte reader.
_gz_crc32_byteCRC-32 table (precomputed for polynomial 0xEDB88320). We compute it on-the-fl…
gzip_crc32Compute CRC-32 of buffer.
_gz_write16Internal: write little-endian 16-bit value.
_gz_write32Internal: write little-endian 32-bit value.
_gz_read32Internal: read little-endian 32-bit value.
gzip_compressCompress data with gzip stored-block format. Returns output length.
gzip_is_gzipCheck if buffer starts with gzip magic bytes.
gzip_orig_sizeRead original size from gzip trailer (last 4 bytes).
gzip_decompressDecompress gzip stored-block data. Returns output length.

Details

_gz_byte_at

fn _gz_byte_at(buf: &i8, idx: i64) -> i64

Internal byte reader.

_gz_crc32_byte

fn _gz_crc32_byte(crc: i64, byte_val: i64) -> i64

CRC-32 table (precomputed for polynomial 0xEDB88320). We compute it on-the-fly per byte.

gzip_crc32

fn gzip_crc32(buf: &i8, len: i64) -> i64

Compute CRC-32 of buffer.

_gz_write16

fn _gz_write16(out: &i8, pos: i64, val: i64) -> i64

Internal: write little-endian 16-bit value.

_gz_write32

fn _gz_write32(out: &i8, pos: i64, val: i64) -> i64

Internal: write little-endian 32-bit value.

_gz_read32

fn _gz_read32(buf: &i8, pos: i64) -> i64

Internal: read little-endian 32-bit value.

gzip_compress

fn gzip_compress(input: &i8, in_len: i64, out: &i8) -> i64

Compress data with gzip stored-block format. Returns output length.

gzip_is_gzip

fn gzip_is_gzip(buf: &i8, len: i64) -> i64

Check if buffer starts with gzip magic bytes.

gzip_orig_size

fn gzip_orig_size(buf: &i8, len: i64) -> i64

Read original size from gzip trailer (last 4 bytes).

gzip_decompress

fn gzip_decompress(input: &i8, in_len: i64, out: &i8) -> i64

Decompress gzip stored-block data. Returns output length.