https://github.com/neoxic/lua-ezlib
Easy zlib module for Lua
https://github.com/neoxic/lua-ezlib
Last synced: 5 months ago
JSON representation
Easy zlib module for Lua
- Host: GitHub
- URL: https://github.com/neoxic/lua-ezlib
- Owner: neoxic
- License: mit
- Created: 2019-06-24T05:22:28.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-04-13T05:49:34.000Z (over 4 years ago)
- Last Synced: 2025-06-09T23:37:26.069Z (7 months ago)
- Language: C
- Homepage:
- Size: 5.86 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Easy zlib module for Lua
========================
[lua-ezlib] provides the following API:
### ezlib.deflate(str, [fmt], [lvl])
Deflates `str` using the format `fmt` (a string) that can be one of the following:
- `zlib`: zlib format (default);
- `gzip`: gzip format;
- `raw`: raw deflate;
Optional compression level `lvl` must be between 0 and 9 (the default is 6).
### ezlib.inflate(str, [fmt])
Inflates `str` using the format `fmt` (a string) that can be one of the following:
- `zlib`: zlib format (default);
- `gzip`: gzip format;
- `raw`: raw inflate;
- `auto`: zlib or gzip format;
### ezlib.type(str)
Returns the type of compressed data in `str`. Possible values are `'zlib'`, `'gzip'` or `nil`.
### ezlib.crc32(str)
Returns a CRC-32 checksum for `str`.
### ezlib.adler32(str)
Returns an Adler-32 checksum for `str`.
Building and installing with LuaRocks
-------------------------------------
To build and install, run:
luarocks make
luarocks test
To install the latest release using [luarocks.org], run:
luarocks install lua-ezlib
[lua-ezlib]: https://github.com/neoxic/lua-ezlib
[luarocks.org]: https://luarocks.org