
Serving Hacker Jargon to the Internet since Jan 1995.
magic number /n./ [Unix/C] 1. In source code, some non-obvious constant whose value is significant to the operation of a program and that is inserted inconspicuously in-line (hardcoded), rather than expanded in by a symbol set by a commented `#define'. Magic numbers in this sense are bad style. 2. A number that encodes critical information used in an algorithm in some opaque way. The classic examples of these are the numbers used in hash or CRC functions, or the coefficients in a linear congruential generator for pseudo-random numbers. This sense actually predates and was ancestral to the more commonsense 1. 3. Special data located at the beginning of a binary data file to indicate its type to a utility. Under Unix, the system and various applications programs (especially the linker) distinguish between types of executable file by looking for a magic number. Once upon a time, these magic numbers were PDP-11 branch instructions that skipped over header data to the start of executable code; 0407, for example, was octal for `branch 16 bytes relative'. Many other kinds of files now have magic numbers somewhere; some magic numbers are, in fact, strings, like the `!' at the beginning of a Unix archive file or the `%!' leading PostScript files. Nowadays only a wizard knows the spells to create magic numbers. How do you choose a fresh magic number of your own? Simple -- you pick one at random. See? It's magic!
Cool Jargon changes every 00:00 GMT. Please come back often.

The Best InterNet Reference Desk
Buy the book, The New Hacker's Dictionary,
Paperback,
Hardcover.
This page is maintained by
Stephen Jazdzewski (Steve@Jazd.com)
and
Charles Jazdzewski (Chuck@Jazd.com)
Page Awards
Back to ADB.Net
Copyright © 1995-2011 Advanced Database Networking