Skip to content

compress #

Description

compress is a namespace for (multiple) compression algorithms supported by V.

At the moment, the following compression algorithms are implemented:

  • compress.deflate
  • compress.gzip
  • compress.zlib
  • compress.zstd

Constants #

const max_size = u64(1 << 31)

fn compress #

fn compress(data []u8, flags int) ![]u8

compresses an array of bytes based on providing flags and returns the compressed bytes in a new array NB: this is a low level api, a high level implementation like zlib/gzip should be preferred

fn decompress #

fn decompress(data []u8, flags int) ![]u8

decompresses an array of bytes based on providing flags and returns the decompressed bytes in a new array NB: this is a low level api, a high level implementation like zlib/gzip should be preferred