zstd#

Internal zstd backend selector.

Import zstd for library API (zstd.ZstdFile, zstd.compress, …). Import ZstdError for exception handling. Import capped_decompress for bounded one-shot decompression of untrusted data (mimics

zstandard.decompress(..., max_output_size=...) and ZstdDecompressor(max_window_size=...)).

Functions#

capped_decompress(→ bytes)

One-shot decompress of untrusted data with output and window bounds.

capped_decompress(data: bytes, max_output_size: int) bytes#

One-shot decompress of untrusted data with output and window bounds.

Replaces zstandard.decompress(..., max_output_size=...) and ZstdDecompressor(max_window_size=...) (window cap was only in subset.py).