Zstandard Compressed
Zstandard (zstd) is a fast lossless compression algorithm developed by Yann Collet at Meta in 2015. It achieves compression ratios comparable to gzip while being significantly faster at both compression and decompression, with 22 adjustable compression levels.
Zstandard decompression requires libzstd not available in browser WASM.
أسئلة شائعة
How do I open or inspect a ZST file?
Use zstd -dk file.zst to decompress while keeping the original, or zstdcat file.zst | head to preview content. On Windows, recent versions of 7-Zip support .zst files. Use zstd -l file.zst to view compression stats.
What compression level should I use with zstd?
Level 3 (default) balances speed and ratio for most workloads. Levels 1-4 are speed-optimized. Levels 15-19 are ratio-optimized. Levels 20-22 are ultra mode for maximum compression with significantly slower speed.
What is dictionary compression in Zstandard?
Dictionary compression pre-trains a model on representative sample data, allowing zstd to achieve high compression ratios even on small files (under 4 KB) where LZ77 cannot build sufficient context. Both compressor and decompressor must share the same dictionary.
Why are Linux distributions switching to zstd?
Zstandard packages decompress 5-10x faster than xz packages with only slightly larger file sizes. For package managers that extract thousands of files per update, the decompression speed gain significantly reduces install time.
ما يميز .ZST
What is a ZST file?
Zstandard (zstd) is a fast lossless compression algorithm developed by Yann Collet at Meta. It provides compression ratios comparable to zlib while being significantly faster at both compression and decompression. Zstandard has been adopted by major systems including Linux kernel, PostgreSQL, and package managers.
اكتشف التفاصيل التقنية
How to open ZST files
- 7-Zip (Windows) — Free, recent versions support zstd
- zstd CLI (Windows, macOS, Linux) —
zstd -d file.zst - tar (Linux) —
tar --zstd -xf archive.tar.zst - PeaZip (Windows, Linux) — Free GUI
Technical specifications
| Property | Value |
|---|---|
| Algorithm | Zstandard (LZ77 + FSE) |
| Compression Levels | 1-22 (configurable) |
| Speed | 400-500 MB/s compression, 1+ GB/s decompression |
| Dictionary | Trainable dictionaries for small data |
| Standard | RFC 8478, RFC 8878 |
Common use cases
- Package managers: Arch Linux pacman, Fedora RPMs use zstd.
- Databases: PostgreSQL and RocksDB compression.
- Filesystem: Btrfs transparent compression.
- Networking: HTTP content encoding.
المرجع التقني
- نوع MIME
application/zstd- Magic Bytes
28 B5 2F FDZstandard magic number.- المطوّر
- Yann Collet / Meta
- سنة التقديم
- 2016
- معيار مفتوح
- نعم — عرض المواصفات
Zstandard magic number.
البنية الثنائية
A Zstandard file contains one or more frames. Each frame starts with the 4-byte magic number 28 B5 2F FD, followed by a frame header containing a frame header descriptor byte, an optional window descriptor (specifying the decompression window size), optional dictID and content size fields. The frame body consists of one or more blocks, each prefixed by a 3-byte block header indicating block type (raw, RLE, or compressed) and block size. Compressed blocks use LZ77 matching with Finite State Entropy (FSE) coding for literals and match lengths. The frame ends with an optional 4-byte content checksum (xxHash-64 truncated to 32 bits). Skippable frames with magic 18 4D 2A 5_ can be interleaved for metadata.
| Offset | Length | Field | Example | Description |
|---|---|---|---|---|
0x00 | 4 bytes | Frame Magic Number | 28 B5 2F FD | Identifies the start of a Zstandard frame. |
0x04 | 1 byte | Frame Header Descriptor | varies | Bit field encoding: frame content size flag (2 bits), single segment flag, content checksum flag, dictID size flag, and reserved bit. |
0x05 | 1 byte | Window Descriptor | varies | Specifies decompression window size as mantissa + exponent. Absent if single segment flag is set. |
varies | 0-4 bytes | Dictionary ID | varies | Optional dictionary ID field (0, 1, 2, or 4 bytes) identifying which pre-trained dictionary to use. |
varies | 3 bytes per block | Block Header | varies | Encodes last-block flag (1 bit), block type (2 bits: raw/RLE/compressed/reserved), and block size (21 bits). |
EOF-4 | 4 bytes | Content Checksum | varies | xxHash-64 of original content truncated to 32 bits. Present only if checksum flag is set in frame header. |
نقاط الضعف
- Decompression bomb: crafted zstd frame with extreme ratio can exhaust memory during extraction
- Malformed frame header can cause older zstd versions to read out-of-bounds window descriptor
الحماية: FileDex does not decompress, parse, or execute ZST content. Reference page only — no server-side processing.