lz4compress
LZ4 helpers, also on crypt.
Syntax
lz4compress(data: string) -> string
Parameters
| Parameter | Type | Description |
|---|---|---|
data | string | The data payload to process or send. |
Returns
| Type | Description |
|---|---|
string | The 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.