GNUMERIC
application/x-gnumeric
Magic Bytes
Offset: 39
3D 3C 67 6D 72 3A 57 6F 72 6B 62 6F 6F 6B
The Gnumeric file format is an XML-based spreadsheet standard developed by the GNOME Project specifically for the Gnumeric application. It serves as the native storage method for organizing tabular data, performing high-precision statistical calculations, and generating financial models within the GNOME desktop environment. Although the raw format consists of plain text markup, these files are frequently compressed using gzip to optimize storage efficiency while maintaining interoperability with other open-source office suites.
Validation Code
How to validate .gnumeric files in Python
Python
def is_gnumeric(file_path: str) -> bool:
"""
Check if file is a valid GNUMERIC by magic bytes.
Signature offset: 39 bytes
"""
signature = bytes([0x3D, 0x3C, 0x67, 0x6D, 0x72, 0x3A, 0x57, 0x6F, 0x72, 0x6B, 0x62, 0x6F, 0x6F, 0x6B])
with open(file_path, "rb") as f:
f.seek(39)
return f.read(14) == signature
How to validate .gnumeric files in Node.js
Node.js
function isGNUMERIC(buffer: Buffer): boolean {
// Signature offset: 39 bytes
const signature = Buffer.from([0x3D, 0x3C, 0x67, 0x6D, 0x72, 0x3A, 0x57, 0x6F, 0x72, 0x6B, 0x62, 0x6F, 0x6F, 0x6B]);
if (buffer.length < 53) return false;
return buffer.subarray(39, 53).equals(signature);
}
Go
func IsGNUMERIC(data []byte) bool {
// Signature offset: 39 bytes
signature := []byte{0x3D, 0x3C, 0x67, 0x6D, 0x72, 0x3A, 0x57, 0x6F, 0x72, 0x6B, 0x62, 0x6F, 0x6F, 0x6B}
if len(data) < 53 {
return false
}
return bytes.Equal(data[39:53], signature)
}
API Endpoint
GET
/api/v1/gnumeric
curl https://filesignature.org/api/v1/gnumeric