pysapcompress library¶
- pysapcompress.compress(data, algorithm=0)[source]¶
Compress data using the given SAP algorithm.
- Parameters:
data (bytes) – data to compress
algorithm (int) – ALG_LZC (0) or ALG_LZH (2)
- Returns:
tuple (status, compressed_length, compressed_bytes)
- Return type:
tuple[int, int, bytes]
- Raises:
CompressError – on error
- pysapcompress.decompress(data, out_length)[source]¶
Decompress data, expecting out_length uncompressed bytes.
- Parameters:
data (bytes) – compressed data (including 8-byte SAP header)
out_length (int) – expected uncompressed length
- Returns:
tuple (status, decompressed_length, decompressed_bytes)
- Return type:
tuple[int, int, bytes]
- Raises:
DecompressError – on error