XU XUv0.13.1
中文

#compress/zstd

import: #compress/zstd

counts: 2 functions, 0 methods, 0 types, 4 constants, 0 method sets

`github.com/klauspost/compress/zstd`: Zstandard compression / decompression format per RFC 8878. Generates and parses standard Zstandard frames (magic 0xFD2FB528). Supports Raw_Block and RLE_Block encoding and decoding. Compressed blocks (Huffman / FSE) are not currently supported.

const MAGIC

XuAPI
pub const MAGIC = 4247762216

Purpose

Constant MAGIC, defining protocol or algorithm parameters.

const BLOCK_RAW

XuAPI
pub const BLOCK_RAW = 0

Purpose

Constant BLOCK_RAW, defining protocol or algorithm parameters.

const BLOCK_RLE

XuAPI
pub const BLOCK_RLE = 1

Purpose

Constant BLOCK_RLE, defining protocol or algorithm parameters.

const MAX_BLOCK_SIZE

XuAPI
pub const MAX_BLOCK_SIZE = 131072

Purpose

Constant MAX_BLOCK_SIZE, defining protocol or algorithm parameters.

compress

XuAPI
pub fn compress(src &string) string

Purpose

Execute compress.

Parameters

src &string
source (read-only borrow; caller keeps the original; type &string)

Returns

string — result string

decompress

XuAPI
pub fn decompress(src &string) string

Purpose

Execute decompress. Throws on failure; handle the error or propagate it to the caller.

Parameters

src &string
source (read-only borrow; caller keeps the original; type &string)

Returns

string — result string