Skip to content

lz4compress

lz4compress compresses a string with the LZ4 compression algorithm.

function lz4compress(data: string): string

Parameters

Parameter Description
data The string to compress.

Example

Compressing a string with the LZ4 compression algorithm
1
2
3
local text = "Hello, world! Hello, world! Goodbye, world!"
print(#text) -- 43
print(#lz4compress(text)) -- 34