TEXINFO
application/x-texinfo
Magic Bytes
Offset: 0
5C 69 6E 70 75 74 20 74 65 78 69 6E 66 6F
Texinfo is a documentation system and file format developed and maintained by the GNU Project. It is primarily used to produce both printed manuals and online hypertext documentation from a single source file, serving as the official documentation format for GNU software. As a plain text macro language, Texinfo files are generally considered safe; however, they require specific processing tools like Makeinfo to convert the source into readable formats like HTML, PDF, or Info.
Validation Code
How to validate .texinfo files in Python
Python
def is_texinfo(file_path: str) -> bool:
"""Check if file is a valid TEXINFO by magic bytes."""
signature = bytes([0x5C, 0x69, 0x6E, 0x70, 0x75, 0x74, 0x20, 0x74, 0x65, 0x78, 0x69, 0x6E, 0x66, 0x6F])
with open(file_path, "rb") as f:
return f.read(14) == signature
How to validate .texinfo files in Node.js
Node.js
function isTEXINFO(buffer: Buffer): boolean {
const signature = Buffer.from([0x5C, 0x69, 0x6E, 0x70, 0x75, 0x74, 0x20, 0x74, 0x65, 0x78, 0x69, 0x6E, 0x66, 0x6F]);
return buffer.subarray(0, 14).equals(signature);
}
Go
func IsTEXINFO(data []byte) bool {
signature := []byte{0x5C, 0x69, 0x6E, 0x70, 0x75, 0x74, 0x20, 0x74, 0x65, 0x78, 0x69, 0x6E, 0x66, 0x6F}
if len(data) < 14 {
return false
}
return bytes.Equal(data[:14], signature)
}
API Endpoint
GET
/api/v1/texinfo
curl https://filesignature.org/api/v1/texinfo