tinycompress.lzsswΒΆ

Lempel-Ziv-Storer-Szymanski via Words compression algorithm.

This module implements the LZSSW compression algorithm, a variant of LZSS. The algorithm maintains a ring buffer and uses bit flags to indicate compressed vs uncompressed data.

The compressor parameters can be tuned for different use cases: - Ring buffer size controls how far back to look for matches - Maximum match length affects compression ratio vs processing time - Common byte value can be optimized for specific data types

Attributes

RING_SIZE_MIN

Minimum ring buffer size.

RING_SIZE_MAX

Maximum ring buffer size.

RING_SIZE_DEF

Default uses maximum size.

MAX_MATCH_LEN_MIN

Minimum match length limit.

MAX_MATCH_LEN_MAX

Maximum match length limit.

MAX_MATCH_LEN_DEF

Default match length.

COMMON_BYTE_DEF

Default byte value used to fill the initial ring buffer.

Functions

compress

Compresses data using the LZSSW algorithm.

decompress

Decompresses LZSSW-compressed data.

main

Command-line interface for LZSSW compression/decompression.

open

Opens an LZSSW compressed file.

Classes

LZSSWCompressor

LZSSW compression implementation.

LZSSWDecompressor

LZSSW decompression implementation.

LZSSWFile

File-like object for reading/writing LZSSW compressed files.

Exceptions

LZSSWException

Exception raised for LZSSW compression/decompression errors.