Skip to main content

compress

Function compress 

Source
pub fn compress(data: &[u8], level: i32) -> Vec<u8> 
Expand description

Compress data into a zstd frame.

level controls the compression strategy:

  • 0: no compression (raw blocks, fastest)
  • 1-2: greedy matching (fast, hash_log=14)
  • 3-5: lazy matching (better ratio, hash_log=15)
  • 6-8: lazy matching + deeper search (hash_log=16)
  • 9-11: lazy matching + deepest search (hash_log=17)

Returns a valid zstd frame decompressible by any conformant decoder.