-
Notifications
You must be signed in to change notification settings - Fork 9
/
README
39 lines (29 loc) · 1.14 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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.