|
| 1 | +Description |
| 2 | +----------- |
| 3 | + |
| 4 | +`compress.deflatelua` is a library implementing [DEFLATE], as well as |
| 5 | +[zlib] and [gzip] decompression in pure [Lua]. |
| 6 | + |
| 7 | +Example usage |
| 8 | +------------- |
| 9 | + |
| 10 | + ./gunziplua lua-5.1.4.tar.gz |
| 11 | + |
| 12 | +Performance |
| 13 | +----------- |
| 14 | + |
| 15 | +It's somewhat slow (as expected). To decompress `lua-5.1.4.tar.gz`, it |
| 16 | +takes about 9 seconds with CRC-checking enabled (4 with LuaJIT 1.x) or |
| 17 | +3 seconds with CRC checking disabled (2 with LuaJIT 1.x). |
| 18 | + |
| 19 | +Rationale |
| 20 | +--------- |
| 21 | + |
| 22 | +Possible reasons for this module include: |
| 23 | + |
| 24 | +1. for pedagogical reasons |
| 25 | +2. to benchmark Lua |
| 26 | +3. to bootstrap applications like LuaRocks/LuaDist |
| 27 | + that might not have a precompiled copy of gunzip, and |
| 28 | +4. because [DEFLATE] has been implemented in other languages too, |
| 29 | + including Python, Perl, and Lisp. |
| 30 | + |
| 31 | +Status |
| 32 | +------ |
| 33 | + |
| 34 | +It should be robust and there are no known bugs. It successfully |
| 35 | +decompresses gzip files but there is currently no compressor implementation. |
| 36 | + |
| 37 | +Dependencies |
| 38 | +------------ |
| 39 | + |
| 40 | +* [digest.crc32lua] - CRC-32 checksum implemented in pure Lua |
| 41 | +* [bit.numberlua] - bitwise operations implemented in pure Lua as numbers |
| 42 | + (note: if using a native bitwise operation library, you can replace |
| 43 | + `bxor` as appropriate in `digest.crc32lua` and omit this library) |
| 44 | +* [pythonic.optparse] - command-line processing resembling the Python |
| 45 | + optparse module |
| 46 | + |
| 47 | +Conventions |
| 48 | +----------- |
| 49 | + |
| 50 | +The modules above follow a somewhat Perl CPAN-like naming convention. |
| 51 | +Compare to [`Compress::Zlib::Perl`], [`Digest::CRC32`] and the `Bit::` |
| 52 | +modules. |
| 53 | + |
| 54 | +Author |
| 55 | +------ |
| 56 | + |
| 57 | +David Manura. See COPYRIGHT file. |
| 58 | + |
| 59 | + |
| 60 | +[DEFLATE]: http://tools.ietf.org/html/rfc1951 |
| 61 | +[zlib]: http://tools.ietf.org/html/rfc1950 |
| 62 | +[gzip]: http://tools.ietf.org/html/rfc1952 |
| 63 | +[Lua]: http://www.lua.org/ |
| 64 | +[digest.crc32lua]: http://github.com/davidm/lua-digest-crc32lua |
| 65 | +[bit.numberlua]: http://github.com/davidm/lua-bit-numberlua |
| 66 | +[pythonic.optparse]: http://github.com/davidm/lua-pythonic-optparse |
| 67 | +[`Compress::Zlib::Perl`]: http://search.cpan.org/~nwclark/Compress-Zlib-Perl/Perl.pm |
| 68 | +[`Digest::CRC32`]: http://search.cpan.org/~fays/Digest-Crc32/Crc32.pm |
0 commit comments