BIBTEX
application/x-bibtex-text-file
Magic Bytes
Offset: 0
25 20 42 69 62 54 65 58 20 60
BibTeX is a specialized bibliographic data format originally developed by Oren Patashnik for use with the LaTeX document preparation system. It serves as a standard for researchers to store structured citation information, facilitating the automated generation of bibliographies and references across academic publications. While the format is inherently safe due to its plain text nature, users should remain cautious of potential parser vulnerabilities within specific reference management software applications.
Validation Code
How to validate .bibtex files in Python
Python
def is_bibtex(file_path: str) -> bool:
"""Check if file is a valid BIBTEX by magic bytes."""
signature = bytes([0x25, 0x20, 0x42, 0x69, 0x62, 0x54, 0x65, 0x58, 0x20, 0x60])
with open(file_path, "rb") as f:
return f.read(10) == signature
How to validate .bibtex files in Node.js
Node.js
function isBIBTEX(buffer: Buffer): boolean {
const signature = Buffer.from([0x25, 0x20, 0x42, 0x69, 0x62, 0x54, 0x65, 0x58, 0x20, 0x60]);
return buffer.subarray(0, 10).equals(signature);
}
Go
func IsBIBTEX(data []byte) bool {
signature := []byte{0x25, 0x20, 0x42, 0x69, 0x62, 0x54, 0x65, 0x58, 0x20, 0x60}
if len(data) < 10 {
return false
}
return bytes.Equal(data[:10], signature)
}
API Endpoint
GET
/api/v1/bibtex
curl https://filesignature.org/api/v1/bibtex