Documentation
¶
Overview ¶
Package zstd implements RFC 8878 zstd frames for NYA. House encoder/decoder — studied klauspost/compress and libzstd; this code is in-house.
Index ¶
- func DecompressZstd(data []byte) ([]byte, error)
- func DecompressZstdLegacy(data []byte) ([]byte, error)
- func DecompressZstdWithDict(data, dict []byte) ([]byte, error)
- func ZstdCompress(src []byte, level int) []byte
- func ZstdCompressWithDict(src []byte, level int, dict []byte) []byte
- func ZstdCompressWithWindow(src []byte, level int) []byte
- func ZstdDecompress(data []byte) ([]byte, error)
- func ZstdNewReader(r io.Reader) (io.ReadCloser, error)
- func ZstdNewReaderLegacy(r io.Reader) (io.ReadCloser, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecompressZstd ¶
DecompressZstd decompresses Zstandard compressed data (RFC 8878).
func DecompressZstdLegacy ¶
DecompressZstdLegacy decompresses pre-v1.1 zstd frames (NYA minor version 0).
func DecompressZstdWithDict ¶
DecompressZstdWithDict decompresses a frame that was encoded with ZstdCompressWithDict using the same dictionary bytes. The dict is a match-window prefix only — it is not part of the returned content.
func ZstdCompress ¶
ZstdCompress compresses data using Zstandard format (RFC 8878). level: 1 (fastest) to 19 (best compression). Default 3 if 0.
func ZstdCompressWithDict ¶
ZstdCompressWithDict compresses with a dictionary prefix. The dict bytes are prepended to the match-finding window so the encoder can reference them, but only src bytes appear in the output frame.
func ZstdCompressWithWindow ¶
ZstdCompressWithWindow compresses data using inter-block windowed matching. Blocks within the frame can reference data from previous blocks via a sliding window, improving compression for data with cross-block repetition.
func ZstdDecompress ¶
ZstdDecompress decompresses Zstandard compressed data.
func ZstdNewReader ¶
func ZstdNewReader(r io.Reader) (io.ReadCloser, error)
ZstdNewReader returns an io.ReadCloser that decompresses RFC 8878 zstd data from r.
func ZstdNewReaderLegacy ¶
func ZstdNewReaderLegacy(r io.Reader) (io.ReadCloser, error)
ZstdNewReaderLegacy decompresses frames from NYA v1.0 archives (minor version 0). See zstd_legacy.go.
Types ¶
This section is empty.