RedLZSS:
Filter:
redSys/Classes (extension) | Red >  > redTools

RedLZSS
ExtensionExtension

lzss compression/decompression

Description

See http://michael.dipperstein.com/lzss/ and http://en.wikipedia.org/wiki/Lempel-Ziv-Storer-Szymanski

A dictionary look-up compressor that performs best with long repeating patterns e.g. [0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3].

NOTE: Only works with 8bit Integer (0-255) values.

Class Methods

.compress

Expects an array of 8bit integers. Returns a string of binary numbers.

.decompress

Expects a string of binary numbers. Returns an array of 8bit integers.

.binaryStringToBytes

Converts a binary string into 8-bit bytes. Up to 7 zeros might be padded automatically at the end. The number of zeros is stored in *pad. *pad is semi-private and used when converting back to bytes.

.bytesToBinaryString

Converts an array of 8-bit bytes into a binary string.

.pad

Semi-private counter for number of padded zeros. Set by *binaryStringToBytes and read by *bytesToBinaryString.

.window

Maximum sliding window size. The default is 4096.

.length

Maximum length for matching pattern. The default is 32.

Examples