JavaScript implementation of minilzo (lzo1x algorithm)
JavaScript C Makefile HTML
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples/node
src
tests
LICENSE
README
TODO

README

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 45: compress 50MByte/s, decompress 77MByte/s
Firefox 41.0a2: compress 43MByte/s, decompress 51MByte/s
Safari 8: compress 44MByte/s, decompress 59MByte/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.