Crate compress
Expand description
Unix compress LZW formats:
CompressLzw(compress 3.0+ / 4.0 / ncompress, magic0x1F 0x9D, block mode)CompressLzw2(compress 2.0, magic0x1F 0x9D, non-block mode)CompressLzw1(compress 1.0, headerless stream)
Specification reference: data/docs/compress-ncompress.md
Reference decompressor: old/unix-tools/gzip-1.14/gzip-1.14/unlzw.c
Constants§
- BIT_
MASK - Maxbits mask in header byte 2 (
0x1F). - BLOCK_
MODE - Block mode mask bit in header byte 2 (
0x80). - CLEAR_
CODE - Special CLEAR code emitted in block mode to flush dictionary (256).
- FIRST_
FREE_ BLOCK - First free dictionary entry in block mode (257).
- FIRST_
FREE_ NONBLOCK - First free dictionary entry in non-block mode (256).
- INIT_
BITS - Initial bit width for LZW codes (9 bits).
- LZW_
MAGIC - Magic header bytes for
.ZLZW compress format (0x1F,0x9D). - LZW_
RESERVED - Reserved bits in header byte 2 (
0x60). - MAX_
BITS - Default maximum bit width for LZW codes (16 bits).
Functions§
- compress_
lzw_ stream - Compresses a stream using the specified LZW format variant (
CompressLzw,CompressLzw2,CompressLzw1,CompressLzw16). Compresses a stream using the specified LZW format variant (CompressLzw,CompressLzw2,CompressLzw1,CompressLzw16). - decompress_
lzw_ stream - Decompresses a stream using the specified LZW format variant (
CompressLzw,CompressLzw2,CompressLzw1,CompressLzw16).