NUP
application/octet-stream
Magic Bytes
Offset: 0
4E 55 52 55 49 4D 47 4E 55 52 55 50 41 4C
The NUP file format is a specialized image and palette container developed for the Nuru terminal graphics specification. It is primarily utilized by digital artists to store character-based ANSI artwork and associated color palettes for display within terminal environments or retro-style applications. As a static binary format, it is considered safe from script-based vulnerabilities, although users should exercise standard precautions when opening files from unknown sources to avoid potential buffer overflow exploits in legacy software.
Validation Code
How to validate .nup files in Python
Python
def is_nup(file_path: str) -> bool:
"""Check if file is a valid NUP by magic bytes."""
signature = bytes([0x4E, 0x55, 0x52, 0x55, 0x49, 0x4D, 0x47, 0x4E, 0x55, 0x52, 0x55, 0x50, 0x41, 0x4C])
with open(file_path, "rb") as f:
return f.read(14) == signature
How to validate .nup files in Node.js
Node.js
function isNUP(buffer: Buffer): boolean {
const signature = Buffer.from([0x4E, 0x55, 0x52, 0x55, 0x49, 0x4D, 0x47, 0x4E, 0x55, 0x52, 0x55, 0x50, 0x41, 0x4C]);
return buffer.subarray(0, 14).equals(signature);
}
Go
func IsNUP(data []byte) bool {
signature := []byte{0x4E, 0x55, 0x52, 0x55, 0x49, 0x4D, 0x47, 0x4E, 0x55, 0x52, 0x55, 0x50, 0x41, 0x4C}
if len(data) < 14 {
return false
}
return bytes.Equal(data[:14], signature)
}
API Endpoint
GET
/api/v1/nup
curl https://filesignature.org/api/v1/nup