LZ4 Native Extension

#1

I’ve just released a native extension version of lua-lz4 over on GitHub:

I only have access to a Mac at the moment, so I’d appreciate it if someone on Linux and/or Windows could make sure it works there too.

Installation

You can use defold-lz4 in your own project by adding it as a Defold library dependency. 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 for documentation. Quick example:

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

And yes, this is for Unfold.

11 Likes

#2

Release v1.1


  • Added .gitignore
  • Added build status badge to README.md
  • Fixed undeclared identifier on non-Darwin platforms

Add it to your project via https://github.com/JustAPotota/defold-lz4/archive/v1.1.zip

3 Likes