Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/JustAPotota/defold-lz4
Defold native extension port of witchu/lua-lz4
https://github.com/JustAPotota/defold-lz4
Last synced: 4 months ago
JSON representation
Defold native extension port of witchu/lua-lz4
- Host: GitHub
- URL: https://github.com/JustAPotota/defold-lz4
- Owner: JustAPotota
- License: mit
- Created: 2020-12-12T21:30:15.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-12-10T04:24:36.000Z (about 1 year ago)
- Last Synced: 2023-12-10T05:19:15.995Z (about 1 year ago)
- Language: C
- Size: 203 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-defold - LZ4
README
[![Build with bob](https://github.com/JustAPotota/defold-lz4/actions/workflows/bob.yml/badge.svg)](https://github.com/JustAPotota/defold-lz4/actions/workflows/bob.yml)
# defold-lz4
Port of [witchu/lua-lz4](https://github.com/witchu/lua-lz4) to [Defold](https://www.defold.com/)'s native extension format.## Installation
You can use defold-lz4 in your own project by adding it as a [Defold library dependency](https://defold.com/manuals/libraries/). Open your game.project file and in the dependencies field add:https://github.com/JustAPotota/defold-lz4/archive/master.zip
Or point to the ZIP file of a specific release, e.g. https://github.com/JustAPotota/defold-lz4/archive/v1.0.zip.
## Usage
Refer to [lua-lz4](https://github.com/witchu/lua-lz4) for documentation. Quick example:
```lua
function init(self)
local s = "LZ4 is a very fast compression and decompression algorithm."
print("Original: " .. s)
local compressed = lz4.block_compress(s)
print("Compressed: " .. compressed)
local decompressed = lz4.block_decompress_safe(compressed, #s)
print("Decompressed: " .. decompressed)
end
```