SQLITE
application/octet-stream
Magic Bytes
Offset: 0
53 51 4C 69 74 65 20 66 6F 72 6D 61 74 20 33 00
SQLite is an ACID-compliant relational database file format maintained by the SQLite Consortium and its primary developer, Richard Hipp. It serves as a self-contained, serverless storage engine for mobile applications, web browsers, and desktop software like Adobe Lightroom or Mozilla Firefox. As a public domain format, it is cross-platform and widely adopted, though developers must manage file system permissions and prevent SQL injection vulnerabilities within their respective application logic.
Validation Code
How to validate .sqlite files in Python
Python
def is_sqlite(file_path: str) -> bool:
"""Check if file is a valid SQLITE by magic bytes."""
signature = bytes([0x53, 0x51, 0x4C, 0x69, 0x74, 0x65, 0x20, 0x66, 0x6F, 0x72, 0x6D, 0x61, 0x74, 0x20, 0x33, 0x00])
with open(file_path, "rb") as f:
return f.read(16) == signature
How to validate .sqlite files in Node.js
Node.js
function isSQLITE(buffer: Buffer): boolean {
const signature = Buffer.from([0x53, 0x51, 0x4C, 0x69, 0x74, 0x65, 0x20, 0x66, 0x6F, 0x72, 0x6D, 0x61, 0x74, 0x20, 0x33, 0x00]);
return buffer.subarray(0, 16).equals(signature);
}
Go
func IsSQLITE(data []byte) bool {
signature := []byte{0x53, 0x51, 0x4C, 0x69, 0x74, 0x65, 0x20, 0x66, 0x6F, 0x72, 0x6D, 0x61, 0x74, 0x20, 0x33, 0x00}
if len(data) < 16 {
return false
}
return bytes.Equal(data[:16], signature)
}
API Endpoint
GET
/api/v1/sqlite
curl https://filesignature.org/api/v1/sqlite