lzw
v0.0.3
Published
Lempel–Ziv–Welch data compression algorithm
Downloads
621
Readme
Info
Library for compress/extend base on Lempel–Ziv–Welch data compression algorithm
Example
var util = require("util");
var assert = require("assert");
var lzw = require("../lzw");
var original = "ababababababababababababab";
assert(original.length > 0);
var compressed = lzw.compress(original);
assert(compressed.length > 0);
var obtained = lzw.extend(compressed);
assert.equal(original.length, obtained.length);
assert.equal(original, obtained.toString());
console.log(util.format("%s bytes -> %s bytes -> %s bytes", original.length, compressed.length, obtained.length));
console.log("original: " + original);
console.log("obtained: " + obtained.toString());