Skip to content

SZ (.sz)

.sz file signature | application/x-snappy-framed

Safe

Magic Bytes

Offset 0
73 4E 61 50 70 59

Sources: Apache Tika

Extension

.sz

MIME Type

application/x-snappy-framed

Byte Offset

0

Risk Level

Safe

Validation Code

How to validate .sz files in Python

Python
def is_sz(file_path: str) -> bool:
    """Check if file is a valid SZ by magic bytes."""
    signature = bytes([0x73, 0x4E, 0x61, 0x50, 0x70, 0x59])
    with open(file_path, "rb") as f:
        return f.read(6) == signature

How to validate .sz files in Node.js

Node.js
function isSZ(buffer: Buffer): boolean {
  const signature = Buffer.from([0x73, 0x4E, 0x61, 0x50, 0x70, 0x59]);
  return buffer.subarray(0, 6).equals(signature);
}

How to validate .sz files in Go

Go
func IsSZ(data []byte) bool {
    signature := []byte{0x73, 0x4E, 0x61, 0x50, 0x70, 0x59}
    if len(data) < 6 {
        return false
    }
    return bytes.Equal(data[:6], signature)
}

API Endpoint

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

See the full API documentation for all endpoints and parameters.

Frequently Asked Questions

What is a .sz file?

A .sz file is a SZ file.

What are the magic bytes for .sz files?

The magic bytes for SZ files are 73 4E 61 50 70 59 at byte offset 0. These bytes uniquely identify the file format regardless of the file extension.

How do I validate a .sz file?

To validate a .sz file, read the first bytes of the file and compare them against the known magic bytes (73 4E 61 50 70 59) at offset 0. This is more reliable than checking the file extension alone, as extensions can be renamed.

What is the MIME type for .sz files?

The primary MIME type for .sz files is application/x-snappy-framed.

Is it safe to open .sz files?

SZ (.sz) files are generally safe to open. They are classified as low risk because they primarily contain data rather than executable code. However, always ensure files come from a trusted source.