In computer programming, the term magic number has multiple meanings. It could refer to one or more of the following:
Magic numbers are common in programs across many operating systems. Magic numbers implement strongly typed data and are a form of in-band signaling to the controlling program that reads the data type(s) at program run-time. Many files have such constants that identify the contained data. Detecting such constants in files is a simple and effective way of distinguishing between many file formats and can yield further run-time information.
- Headers in ZIP files begin with "PK" (
504B), the initials of Phil Katz, author of DOS compression utility PKZIP. - Microsoft Office document files start with
D0CF11E0, which is visually suggestive of the word "DOCFILE0". - WAD files start with
IWADorPWAD(for Doom),WAD2(for Quake) andWAD3(for Half-Life). - LLVM Bitcode files start with
BC(0x42, 0x43) - Unicode text files encoded in UTF-16 often start with the Byte Order Mark to detect endianness (
FEFFfor big endian andFFFEfor little endian). UTF-8 text files often start with the UTF-8 encoding of the same character,EFBBBF. - TIFF files begin with either
IIorMMfollowed by 42 as a two-byte integer in little or big endian byte ordering.IIis for Intel, which uses little endian byte ordering, so the magic number is49492A00.MMis for Motorola, which uses big endian byte ordering, so the magic number is4D4D002A. - etc
Get another information at http://en.wikipedia.org/wiki/Magic_number_(programming)
Tidak ada komentar:
Posting Komentar