Yuari
Documentation
Docs/Crypt/lz4compress

lz4compress

LZ4 helpers, also on crypt.

Syntax

lz4compress(data: string) -> string

Parameters

ParameterTypeDescription
datastringThe data payload to process or send.

Returns

TypeDescription
stringThe returned string.

Description

lz4compress is part of the Crypt library. Crypt functions process data locally. Keys, hashes and encrypted buffers remain inside the process.

The operation is performed immediately using the arguments supplied at the call site.

The aliases lz4decompress(data) resolve to the same implementation.

Example

local packed = lz4compress(string.rep("a", 1000))
print(#packed, #lz4decompress(packed))

Notes

  • Aliases: lz4decompress(data).
  • Never log keys or decrypted buffers in production scripts.