ZST

application/zstd

Safe

Magic Bytes

Offset: 0
28 B5 2F FD

Zstandard (ZST) is an open-source lossless data compression algorithm and file format developed by Meta for efficient real-time data compression. It is widely utilized for system backups, database archives, and as the default compression method for several major Linux distribution package managers. While the format itself is safe, implementations must account for potential memory exhaustion when decompressing untrusted archives that feature significant compression ratios or large dictionary sizes.

Extension

.zst

MIME Type

application/zstd

Byte Offset

0

Risk Level

Safe

Validation Code

How to validate .zst files in Python

Python
def is_zst(file_path: str) -> bool:
    """Check if file is a valid ZST by magic bytes."""
    signature = bytes([0x28, 0xB5, 0x2F, 0xFD])
    with open(file_path, "rb") as f:
        return f.read(4) == signature

How to validate .zst files in Node.js

Node.js
function isZST(buffer: Buffer): boolean {
  const signature = Buffer.from([0x28, 0xB5, 0x2F, 0xFD]);
  return buffer.subarray(0, 4).equals(signature);
}
Go
func IsZST(data []byte) bool {
    signature := []byte{0x28, 0xB5, 0x2F, 0xFD}
    if len(data) < 4 {
        return false
    }
    return bytes.Equal(data[:4], signature)
}

API Endpoint

GET /api/v1/zst
curl https://filesignature.org/api/v1/zst

Related Formats