Skip to content


Repository files navigation

BriefLZ for Lua

Build Status Windows Build Status LDoc

This is a Lua binding for BriefLZ – a small and fast open source implementation of a Lempel-Ziv style compression algorithm by Joergen Ibsen.


You can install BriefLZ using LuaRocks (the Lua package manager):

luarocks install brieflz

or to get the latest development version:

luarocks install --server= brieflz

Tip: If you want to bootstrap development environment for running tests, read the next section.


If you have an old gcc version you may encounter error:

vendor/brieflz/src/brieflz.c: In function ‘blz_pack’:
vendor/brieflz/src/brieflz.c:466:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
  for (unsigned long i = 0; i < LOOKUP_SIZE; ++i) {

In that case you have to explicitly enable C99 mode when installing brieflz:

luarocks install CFLAGS="-std=c99 -Os -fPIC" brieflz

Set up development environment

  1. Clone this repository:

    git clone
    cd brieflz.lua
  2. Install Lua and modules for running tests into directory .venv:

  3. Start hacking!

  • Build native extension:

  • Run tests and linter:



This project is licensed under zlib License. For the full text of the license, see the LICENSE file.