lz4compress
Compresses data as a raw LZ4 block.
Syntax
Signature
lz4compress(Data: string) -> stringAliases
crypt.lz4compress
Parameters
| Parameter | Type | Description |
|---|---|---|
Data | string | Uncompressed bytes, up to 16 MiB. |
Returns
| Type | Description |
|---|---|
string | Raw LZ4 block. |
Notes
The result does not contain the original byte count. Keep that count and pass it to lz4decompress.
Example
Luau
local Text = "hello hello hello"
local Compressed = lz4compress(Text)
assert(lz4decompress(Compressed, #Text) == Text)