lz-deflate
v1.0.4
Published
Encode and decode strings according to the deflate specification (RFC 1951) for LZ77 (Lempel-Ziv 1977) coding. This implements the 'patent free' algorithm described there for 'lazy matching'. This package is not optimized for speed or efficiency and is pr
Maintainers
Readme
lz-deflate
the LZ portion of the deflate algorithm
Example usage:
import LZ from "lz-deflate";
const lz = new LZ();
const encoded = lz.encodeString(
"we had everything we before us, we had nothing before us, we were"
);
//encoded := "we had everything <3,18>before us, <7,32>no<6,29><14,26>were"
//sets tokens.
const decoded = lz.decodeString(encoded);
//sets tokens. lz.tokens
//decoded := "we had everything we before us, we had nothing before us, we were"