Module compress.zlib stdlib

compress.zlib
Version:
0.3.3
License:
MIT
Dependencies from vmod:
0
Imports:
1
Imported by:
1
Repository:
OS-specific
Show selected OS-specific symbols.
Backend-specific
Show selected Backend-specific symbols.

Dependencies defined in v.mod

This section is empty.

Imports

Imported by

Overview

compress.zlib is a module that assists in the compression and decompression of binary data using zlib compression

Examples:

import compress.zlib

fn main() {
    uncompressed := 'Hello world!'
    compressed := zlib.compress(uncompressed.bytes())!
    decompressed := zlib.decompress(compressed)!
    assert decompressed == uncompressed.bytes()
}

Aliases

This section is empty.

Constants

This section is empty.

Sum types

This section is empty.

Functions

#fn compress

fn compress(data []u8) ![]u8

compresses an array of bytes using zlib and returns the compressed bytes in a new array

Example:

compressed := zlib.compress(b)?

#fn decompress

fn decompress(data []u8) ![]u8

decompresses an array of bytes using zlib and returns the decompressed bytes in a new array

Example:

decompressed := zlib.decompress(b)?

Structs

This section is empty.

Interfaces

This section is empty.

Enums

This section is empty.