indiesoftby
indiesoftby/defold-zstd/zstd
The Zstandard Compression Library for Defold
- GitHub: indiesoftby/defold-zstd — pinned to
1.5.7-3(released while Defold 1.11.1 was current)- Pick a release from indiesoftby/defold-zstd releases and add its Source code (zip) URL (or a packaged
.zipasset, if the library ships one) togame.projectunder[project]dependencies, then Fetch Libraries in the Defold editor. - Run
bunx @defold-typescript/cli resolveto materialize its types. - Import it under a namespace alias of your choice:
import * as zstd from "zstd"
- Pick a release from indiesoftby/defold-zstd releases and add its Source code (zip) URL (or a packaged
- Asset Portal: defold-zstd
Functions
zstd.version(): string
Returns the version of the Zstandard library
Returns
version:string
zstd.compress(data: string, level?: number): string
Compresses a string.
Parameters
data:string— The data to compresslevel?:number— Optional compression level (default is 3, maximum is 22)
Returns
compressed_data:string— The compressed data
zstd.decompress(data: string): string
Decompresses a string.
Parameters
data:string— The data to decompress
Returns
decompressed_data:string— The decompressed data