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

RedLZSS : Object
ExtensionExtension

lzss compression/decompression
Source: RedLZSS.sc

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

RedLZSS.compress(input)

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

RedLZSS.decompress(input)

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

RedLZSS.binaryStringToBytes(str)

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.

RedLZSS.bytesToBinaryString(arr)

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

RedLZSS.pad

RedLZSS.pad = value

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

RedLZSS.window

RedLZSS.window = value

Maximum sliding window size. The default is 4096.

RedLZSS.length

RedLZSS.length = value

Maximum length for matching pattern. The default is 32.

Inherited class methods

Instance Methods

Inherited instance methods

Examples