zstddecompress Synchronous

  • crypt.zstd.decompress

Restore data stored in a Zstandard frame. This is the counterpart to zstdcompress, so it belongs at the read side of a Zstandard-backed file or message.

Syntax
Luau
zstddecompress(data: string) -> string

Parameters

Function parameters
ParameterTypeDescription
datastringZstandard-compressed bytes.

Returns

string

The decompressed byte string. Corrupt data or an unsupported frame raises an error.

Usage notes

The function does not auto-detect LZ4 or Base64. Decode an outer Base64 layer first if you added one for text storage.

Example

Example
Luau
local packed = zstdcompress("a saved note")
local ok, note = pcall(zstddecompress, packed)
if ok then print(note) end
Kawaii documentation