magic number

jargon

programmingsecurity

An unexplained constant buried in code, or the signature bytes that identify a file format.

The term carries two related meanings: the anti-pattern (a bare 86400 or 0.85 whose significance lives only in the author's head, cured by named constants) and the file signature (the leading bytes, like PNG's or the 0xCAFEBABE of Java class files, that tell tools what they are reading; the Unix file command is a museum of them). Both senses are about the same thing, meaning encoded without explanation. One is a bug waiting; the other is a convention working.

All glossary entries