strategy

Pstrategy
Bun

Symbol

ZlibCompressionOptions.strategy

strategy?: number

Tunes the compression algorithm.

  • Z_DEFAULT_STRATEGY: For normal data (Default)
  • Z_FILTERED: For data produced by a filter or predictor
  • Z_HUFFMAN_ONLY: Force Huffman encoding only (no string match)
  • Z_RLE: Limit match distances to one (run-length encoding)
  • Z_FIXED prevents the use of dynamic Huffman codes

Z_RLE is designed to be almost as fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data.

Z_FILTERED forces more Huffman coding and less string matching, it is somewhat intermediate between Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY. Filtered data consists mostly of small values with a somewhat random distribution.