Zlib.compress

From GiderosMobile
Revision as of 14:32, 13 July 2023 by Hgy29 (talk | contribs) (Text replacement - "<source" to "<syntaxhighlight")


Available since: Gideros 2015.04.18
Class: zlib

Description

Return a string containing the compressed buffer according to the given parameters. <syntaxhighlight lang="lua"> (string) = zlib.compress(buffer,level,method,windowBits,memLevel,strategy) </source>

Parameters

buffer: (string) string to compress
level: (number) compression level, 0 no compression, 9 best compression, -1 default compression optional
method: (number) compression method, should be 8 for this version optional
windowBits: (number) from 8 to 15, larger values of this parameter result in better compression at the expense of memory usage optional
memLevel: (number) 1 uses minimum memory but is slow and reduces compression ratio; 9 uses maximum memory for optimal speed optional
strategy: (number) 1 - Filtered, 2 - Huffman, 3 - RLE, 4 - Fixed, 0 - default optional

Return values

Returns (string) compressed string