Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

davidm/lua-compress-deflatelua

Repository files navigation

Description

compress.deflatelua is a library implementing DEFLATE, as well as zlib and gzip decompression in pure Lua.

Example usage

./gunziplua lua-5.1.4.tar.gz

Performance

It's somewhat slow (as expected). To decompress lua-5.1.4.tar.gz, it takes about 9 seconds with CRC-checking enabled (4 with LuaJIT 1.x) or 3 seconds with CRC checking disabled (2 with LuaJIT 1.x).

Rationale

Possible reasons for this module include:

  1. for pedagogical reasons
  2. to benchmark Lua
  3. to bootstrap applications like LuaRocks/LuaDist that might not have a precompiled copy of gunzip, and
  4. because DEFLATE has been implemented in other languages too, including Python, Perl, and Lisp.

Status

It should be robust and there are no known bugs. It successfully decompresses gzip files but there is currently no compressor implementation.

Dependencies

  • digest.crc32lua - CRC-32 checksum implemented in pure Lua
  • bit.numberlua - bitwise operations implemented in pure Lua as numbers (not required if using a native bitwise operation library)
  • pythonic.optparse - command-line processing resembling the Python optparse module

Conventions

The modules above follow a somewhat Perl CPAN-like naming convention. Compare to Compress::Zlib::Perl, Digest::CRC32 and the Bit:: modules.

Author

David Manura. See COPYRIGHT file.

About

DEFLATE (RFC1951)/gunzip implemented in pure Lua

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

AltStyle によって変換されたページ (->オリジナル) /