DVI (.dvi)
.dvi file signature | application/x-dvi
Magic Bytes
Offset 0
F7 02
Sources: Apache Tika
All Known Signatures
2 signature variants are documented for .dvi files across multiple sources.
| Hex Signature | Offset | Sources |
|---|---|---|
| F7 02 | 0 | Apache Tika |
| 1B 20 54 65 58 20 6F 75 74 70 75 74 20 | 14 | Apache Tika |
Extension
.dvi
MIME Type
application/x-dvi
Byte Offset
0
Risk Level
Safe
Validation Code
How to validate .dvi files in Python
def is_dvi(file_path: str) -> bool:
"""Check if file is a valid DVI by magic bytes."""
signature = bytes([0xF7, 0x02])
with open(file_path, "rb") as f:
return f.read(2) == signature
How to validate .dvi files in Node.js
function isDVI(buffer: Buffer): boolean {
const signature = Buffer.from([0xF7, 0x02]);
return buffer.subarray(0, 2).equals(signature);
}
How to validate .dvi files in Go
func IsDVI(data []byte) bool {
signature := []byte{0xF7, 0x02}
if len(data) < 2 {
return false
}
return bytes.Equal(data[:2], signature)
}
API Endpoint
/api/v1/dvi
curl https://filesignature.org/api/v1/dvi
See the full API documentation for all endpoints and parameters.
Frequently Asked Questions
What is a .dvi file?
A .dvi file is a DVI file.
What are the magic bytes for .dvi files?
The magic bytes for DVI files are F7 02 at byte offset 0. These bytes uniquely identify the file format regardless of the file extension.
How do I validate a .dvi file?
To validate a .dvi file, read the first bytes of the file and compare them against the known magic bytes (F7 02) at offset 0. This is more reliable than checking the file extension alone, as extensions can be renamed.
What is the MIME type for .dvi files?
The primary MIME type for .dvi files is application/x-dvi.
Is it safe to open .dvi files?
DVI (.dvi) 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.