lzw

0.0.3 • Public • Published

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());
 
 

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i lzw

      Weekly Downloads

      362

      Version

      0.0.3

      License

      none

      Last publish

      Collaborators

      • yaroslavgaponov