minetest.compress

From Minetest Developer Wiki
Jump to: navigation, search

Syntax

minetest.compress(data, method, ...)

Description

Returns compressed_data.

  • Compress a string of data.
  • `method` is a string identifying the compression method to be used.

Supported compression methods:

  • Deflate (zlib): "deflate"
  • `...` indicates method-specific arguments. Currently defined arguments are:
  • Deflate: `level` - Compression level, 0-9 or nil.

You can use this function when saving custom files to disk for reduced disk usage. Since it's compressing, you can decide to use minetest.serialize without worrying about all those redundant whitespaces. Do not use minetest.compress for meta because metadata, entity information, etc. are all already compressed in the map and manually interleaved compression is inefficient.

See also

minetest.decompress



This article is incomplete.




This article is missing examples, feel free to add them.


Personal tools
Namespaces

Variants
Actions
Navigation
API
Toolbox