Skip to content
Saiko

lz4decompress

Decompresses an LZ4 payload. The size hint must be the length of the original uncompressed data.

Signature

luau
lz4decompress(data: string, sizeHint: number): string

Parameters

datastring

The compressed payload.

sizeHintnumber

Length of the original data.

Returns

string

Example

luau
local text = string.rep("saiko ", 200)
local packed = lz4compress(text)

-- the second argument is the length of the original data
local restored = lz4decompress(packed, #text)
print(restored == text) --> true