lz4compress
Compresses a byte string with LZ4.
Syntax
lz4compress(data: string) -> string
Also available as
crypt.lz4compresslz4_compress
Parameters
| Parameter | Type | Description |
|---|---|---|
data | string | Uncompressed bytes. |
Returns
| Type | Description |
|---|---|
string | Compressed binary representation. |
Description
The result is binary data and can contain zero bytes. Keep the original uncompressed size when exchanging data with another LZ4 implementation. Compression is not encryption and does not authenticate the input.
Example
local text = string.rep("sample", 100)
local packed = lz4compress(text)
print(#text, #packed)
assert(lz4decompress(packed, #text) == text)
These are Game executor contracts. Check build requirements and session lifetimes before using them.
