Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Module Zstandard
zstd, short for Zstandard, is a fast lossless compression algorithm, targeting real-time compression scenarios at zlib-level and better compression ratios. The zstd compression library provides in-memory compression and decompression functions. The library supports compression levels from 1 up to max_compression_level () (currently 22). Levels >= 20, labeled `--ultra`, should be used with caution, as they require more memory.
Compression can be done in:
a single step (described as Simple API)
a single step, reusing a context (described as Explicit context)
unbounded multiple steps (described as Streaming compression)
The compression ratio achievable on small data can be highly improved using a dictionary in:
a single step (described as Simple dictionary API)
a single step, reusing a dictionary (described as Bulk-processing dictionary API)
Returns the decompressed size of a message. Since decompressed size is an optional field of compressed message, it might raise Content_size_unknown, Content_size_error or Error.
This module implements compression and decompression with explicitly managed contexts. When compressing or decompressing many times, it is recommended to allocate a context just once, and re-use it for each successive compression operation. This will make workload friendlier for system's memory.
The functions exposed in this module differ from the rest of the library, and operates on stream of data (rather than on single messages). Therefore, the API is more complex, and does not use the Input module.