You can invent your own file formats! Nobody is stopping you. .exe
-files start with 0x4D 0x5A
, or MZ interpretet as ASCII. The initials of Mark Zbikowski
I have been doing some work on a binary log format and thought, why not start it with [0xf0, 0x9f, 0xaa, 0xb5]
?
Magic bytes are used everywhere in binary formats.
The issue with binary formats: You lose the ability to use your regular text based tooling to operate on the format
In my case I ended up building a format that was using printable magic bytes and new lines to separate log entries. So while it is still a binary log format and supports blob storage, it can also be inspected with a text editor and will gracefully degrade