LZFSE
application/octet-stream
Magic Bytes
Offset: 0
62 76 78 32
LZFSE is a data compression algorithm and file format developed by Apple Inc. for efficient performance on iOS and macOS systems. It is primarily used to compress disk images and system payloads, offering a balance between high compression speed and energy efficiency optimized for modern processors. While Apple released the reference implementation as open-source code to ensure broader compatibility, the format remains a standard standard within the Apple ecosystem.
Validation Code
How to validate .lzfse files in Python
Python
def is_lzfse(file_path: str) -> bool:
"""Check if file is a valid LZFSE by magic bytes."""
signature = bytes([0x62, 0x76, 0x78, 0x32])
with open(file_path, "rb") as f:
return f.read(4) == signature
How to validate .lzfse files in Node.js
Node.js
function isLZFSE(buffer: Buffer): boolean {
const signature = Buffer.from([0x62, 0x76, 0x78, 0x32]);
return buffer.subarray(0, 4).equals(signature);
}
Go
func IsLZFSE(data []byte) bool {
signature := []byte{0x62, 0x76, 0x78, 0x32}
if len(data) < 4 {
return false
}
return bytes.Equal(data[:4], signature)
}
API Endpoint
GET
/api/v1/lzfse
curl https://filesignature.org/api/v1/lzfse