lz4decompress

Decompresses a raw LZ4 block.

Syntax

Signature
lz4decompress(Data: string, Size: number) -> string

Aliases

  • crypt.lz4decompress

Parameters

ParameterTypeDescription
DatastringRaw LZ4 block.
SizenumberExact uncompressed byte count from 0 through 16777216.

Returns

TypeDescription
stringUncompressed bytes.

Notes

Compressed input is limited to 32 MiB and output to 16 MiB. Raises an error if decoding fails or the decoded size differs from Size.

Example

Luau
local Text = "hello hello hello"
local Compressed = lz4compress(Text)
print(lz4decompress(Compressed, #Text))