Cryptography

lz4decompress

Decompresses an LZ4 string and optionally validates the expected decompressed size.

Syntax

lz4decompress(data: string, expectedSize?: number): string
Aliases crypt.lz4decompresscrypt.lz4.decompresslz4.decompress

Arguments

NameTypeDescription
datastringInput byte string or text processed by the function.
expectedSize?numberExpected decompressed byte size used for validation.

Returns

NameTypeDescription
decompressedstringDecompressed byte string.

Description

Decompresses an LZ4 string and optionally validates the expected decompressed size.

Call it with 2 parameter(s): data, expectedSize. The argument table explains which values are required and which ones only refine the behavior.

It returns decompressed (string). Use the returns table to separate successful values from nil results and recoverable errors.

Example

Example call with placeholder values.

local result = lz4decompress("example", 1)
print(result)