Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/doujiang24/lua-resty-zip
https://github.com/doujiang24/lua-resty-zip
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/doujiang24/lua-resty-zip
- Owner: doujiang24
- License: mit
- Created: 2016-08-29T07:55:54.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-08-12T05:45:33.000Z (over 5 years ago)
- Last Synced: 2024-02-15T02:32:15.479Z (9 months ago)
- Language: Lua
- Size: 2.93 KB
- Stars: 11
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-resty - lua-resty-zip
README
Name
=============lua-resty-zip - zip functions(compress/uncompress) for LuaJIT
Status
======This library is considered experimental.
Description
===========The code mainly from http://luajit.org/ext_ffi_tutorial.html.
Synopsis
========```lua
# nginx.conf:lua_package_path "/path/to/lua-resty-zip/lib/?.lua;;";
server {
location = /test {
content_by_lua_block {
local zip = require "resty.zip"local txt = string.rep("abcd", 1000)
ngx.say("Uncompressed size: ", #txt)local c = zip.compress(txt, 1)
ngx.say("Compressed size on level 1: ", #c)local c = zip.compress(txt, 9)
ngx.say("Compressed size on level 9: ", #c)local txt2 = zip.uncompress(c, #txt)
assert(txt2 == txt)
}
}
}
```Methods
=======compress
----
`syntax: c = resty.compress(txt, level?)`uncompress
----
`syntax: txt = resty.uncompress(c)`Author
======Dejiang Zhu (doujiang24)