Module brieflz

Lua binding for BriefLZ library.

Functions

pack (data) Compresses the given data using BriefLZ algorithm.
depack (data, depacked_size) Decompresses the given data using BriefLZ algorithm.

Fields

_NAME
_VERSION
_BLZ_VERSION


Functions

pack (data)
Compresses the given data using BriefLZ algorithm.

This is a low-level function, it does not add any headers to the packed data! You must know the exact size of (uncompressed) data to be able to depack it.

Parameters:

  • data string The data to compress.

Returns:

  1. string Compressed data.
  2. int Size of the (uncompressed) data.
  3. int Size of the compressed data.

See also:

depack (data, depacked_size)
Decompresses the given data using BriefLZ algorithm.

This is very low-level function. It does not expect any headers in the packed data, so you must know the exact size of uncompressed data! If you specify incorrect depacked_size, it raises an error. However, it's memory-safe, i.e. it will not segfault in this case.

Parameters:

  • data string The compressed data.
  • depacked_size int Size of the decompressed data (must exactly match!).

Returns:

    string Uncompressed data.

Raises:

if the data or depacked_size is invalid.

See also:

Fields

_NAME
  • _NAME Name of this module.
_VERSION
  • _VERSION Version of this module.
_BLZ_VERSION
  • _BLZ_VERSION Version of the BriefLZ C library.
generated by LDoc 1.4.6