Skip to content

abraidwood/minilzo-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 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 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.

About

JavaScript implementation of minilzo (lzo1x algorithm)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published