LZ compression
The LZ compression family include a large variety of lossless data compression algorithms, all derived from a very simple algorithm created by Abraham Lempel and Jacob Ziv in the late '70s, known as LZ77 . The algorithm is elegant and very dynamic and works excellent on very large input streams, producing the encoded output right away, ready to be decoded at the other end. Many websites are compressed with this algorithm, which reduces their size considerably with almost no cost regarding the decompression time. In this post, we are going to take a look at a new algorithm, very similar with LZSS , called LZT. Compression The compress() function takes two arguments: the input stream, which can have any length, and the output stream which is ready to receive the encoded data chucks. Input : TOBEORNOTTOBEORTOBEORNOT# Output: TOBEORNOT [0,6][0,9] # Steps of the algorithm: Read 256 bytes from the input stre...