compression.lempel_ziv_decompress

One of the several implementations of Lempel-Ziv-Welch decompression algorithm https://en.wikipedia.org/wiki/Lempel%E2%80%93Ziv%E2%80%93Welch

Functions

compress(→ None)

Reads source file, decompresses it and writes the result in destination file

decompress_data(→ str)

Decompresses given data_bits using Lempel-Ziv-Welch compression algorithm

read_file_binary(→ str)

Reads given file as bytes and returns them as a long string

remove_prefix(→ str)

Removes size prefix, that compressed file should have

write_file_binary(→ None)

Writes given to_write string (should only consist of 0's and 1's) as bytes in the

Module Contents

compression.lempel_ziv_decompress.compress(source_path: str, destination_path: str) None

Reads source file, decompresses it and writes the result in destination file

compression.lempel_ziv_decompress.decompress_data(data_bits: str) str

Decompresses given data_bits using Lempel-Ziv-Welch compression algorithm and returns the result as a string

compression.lempel_ziv_decompress.read_file_binary(file_path: str) str

Reads given file as bytes and returns them as a long string

compression.lempel_ziv_decompress.remove_prefix(data_bits: str) str

Removes size prefix, that compressed file should have Returns the result

compression.lempel_ziv_decompress.write_file_binary(file_path: str, to_write: str) None

Writes given to_write string (should only consist of 0’s and 1’s) as bytes in the file