How do I choose a good magic number for my file format?
问题 I am designing a binary file format from scratch, and I would like to include some magic bytes at the beginning so that it can be identified easily. How do I go about choosing which bytes? I am not aware of any central registry of magic numbers, so is it just a matter of picking something fairly random that isn't already identified by, say, the file command on a nearby UNIX box? 回答1: Stay away from super-short magic numbers. Just because you're designing a binary format doesn't mean you can't