A magic number or sometimes referred to as a file signature is a number embedded at or near the beginning of a file that indicates its file format (i.e., the type of file it is). magic number can be viewed using a hex editor.
for example, the magic number for JPEG (Joint Photographic Experts Group) image files is 0x4A464946, which is the ASCII equivalent of JFIF (JPEG File Interchange Format). However, JPEG magic numbers are not the first bytes in the file; rather, they begin with the seventh byte.
Similarly, the magic number for image files having the subsequently introduced GIF89a format is 0x474946383961. For both types of GIF (Graphic Interchange Format) files, the magic number occupies the first six bytes of the file. They are then followed by additional general information (i.e., metadata) about the file.
Tidak ada komentar:
Posting Komentar