Skip to content
Encoding & cryptographyReference

crypt.lz4compress

Compress bytes into a raw LZ4 block.

Aliaseslz4compresscrypt.base64.lz4compress

Details#

Compress bytes into a raw LZ4 block. Binary compressed block. This is not an LZ4 frame or Base64 string.

Signature#

Luau
crypt.lz4compress(data: string): string

Parameters#

ParameterTypeDescription
datastringRaw bytes; inputs larger than the signed int range are rejected.

Returns#

Binary compressed block. This is not an LZ4 frame or Base64 string.

Examples#

Local example

Luau
local packed = crypt.lz4compress("notes notes notes")
print(crypt.lz4decompress(packed)) -- notes notes notes