What is a ZST file?
A ZST file is a compressed file that is generated with the Zstandard (zstd) compression algorithm. It is a compressed file that is created with lossless compression by the algorithm. ZST files can be used to compress different types of files such as databases, file systems, networks, and games. The Zstandard is governed by RFC 8878 that describes the overall compression mechanism, media type, and content encoding.
ZST File Format
ZST files are stored in compressed file format to disc. The compression mechanism is as described by RFC 8878 that obsoletes RFC 8478.
ZST Frames
A ZST file consists of one or more frames. Each frame can be either a Zstandard frame or a skippable frame. A Zstandard frame contains compressed data, whereas a skippable frame contains custom user metadata.
Zstandard Frame
A Zstandard frame has the following structure.
Field | Size in Bytes |
---|---|
Magic_Number | 4 bytes |
Frame_Header | 2-14 bytes |
Data_Block | n bytes |
[More Data_Blocks] | |
[Content_Checksum] | 4 bytes |
Skippable Frame
A skippable frame lets the insertion of user-defined metadata in a flow of concatenated frames. The structure of a skippable frame is as follow.
Magic_Number | Frame_Size | User_Data |
---|---|---|
4 bytes | 4 bytes | n bytes |