userver: compression::zstd Namespace Reference
Loading...
Searching...
No Matches
compression::zstd Namespace Reference

Detailed Description

Zstandard (de)compression helpers.

Functions

std::string Decompress (std::string_view compressed, size_t max_size)
 Decompresses all Zstandard frames in the input, ignoring skippable frames.
std::string Compress (std::string_view data, int compression_level=kDefaultCompressionLevel)
 Compresses the string using the specified compression level.

Variables

const int kDefaultCompressionLevel

Function Documentation

◆ Decompress()

std::string compression::zstd::Decompress ( std::string_view compressed,
size_t max_size )

Decompresses all Zstandard frames in the input, ignoring skippable frames.

Exceptions
std::runtime_errorif the input is invalid or truncated.
compression::TooBigErrorif the combined output exceeds max_size.