Skip to content

JavaScript implementation of minilzo (lzo1x algorithm)

License

Notifications You must be signed in to change notification settings

fengdh/minilzo-js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Summary
-------
A JavaScript typed array implementation of the lzo1x codec found in minilzo.c
http://www.oberhumer.com/opensource/lzo/#minilzo

The purpose of the library is primarily fast decompression in the browser.
Having said that, the compression side is also quite fast.

Syntax
------
lzo1x.compress(state);
lzo1x.decompress(state);

Parameters
----------
state: {
	inputBuffer: <UInt8Array>,
	outputBuffer: null
}

Returns
-------
Functions return lzo1x.codes[OK|INPUT_OVERRUN|OUTPUT_OVERRUN|LOOKBEHIND_OVERRUN|EOF_FOUND]

Functions modify state.outputBuffer to contain a UInt8Array containing compressed or decompressed data.

Performance
-----------
Using ~25,000 test files, I see the following averaged performance on my 2.5GHz i5 (IvyBridge) macbook pro.

Chrome 44: compress 40MByte/s, decompress 50MByte/s
Firefox 41.0a2: compress 28MByte/s, decompress 23MByte/s
Safari 8: compress 39MByte/s, decompress 50MByte/s

Testing
-------
Although tests are not present in this repo, I have tested compression and decompression separately using the output of the compiled minilzo.c (2.09) distribution.  The tests ran using ~25,000 files and all passed.

About

JavaScript implementation of minilzo (lzo1x algorithm)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 93.2%
  • HTML 6.8%