For instance jpeg (JFIF) has a SOI (start of image) marker. One can argue that it can be used to identify the type of file, but I'm looking for more sound reason with supporting examples.

有帮助吗?

解决方案

These are often referred to as "signature bytes" and their primary purpose is simply to aide in validating the file. Some file types contain additional signature bytes elsewhere in the file (ie: BMP format), and some contain none at all. The latter kind still generally provide some other means to validate the file using a variety of techniques, such as checksums, stored file size and the like.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top