unboiled.info
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
RSS Bot@lemmy.bestiver.seMB to Hacker News@lemmy.bestiver.seEnglish · 2 months ago

Recommendations for designing magic numbers of binary file formats

hackers.town

external-link
message-square
0
link
fedilink
2
external-link

Recommendations for designing magic numbers of binary file formats

hackers.town

RSS Bot@lemmy.bestiver.seMB to Hacker News@lemmy.bestiver.seEnglish · 2 months ago
message-square
0
link
fedilink
Zack Weinberg (@zwol@hackers.town)
hackers.town
external-link
another day, another binary file format with a badly designed magic number not gonna call it out specifically but here are some RFC2119 MUSTs for magic number design: MUST be the very first N bytes in the file MUST be at least four bytes long, eight is better MUST include at least one byte with the high bit set MUST include a byte sequence that is invalid UTF-8 SHOULD include a zero byte, but you can usually get away with having that be part of the overall version number that immediately follows the magic number (did I mention that you really SHOULD put an overall version number right after the magic number, unless you know and have documented exactly why it's not necessary, e.g. PNG?) good examples: * PNG * ELF bad examples: * GIF * PE * PDF

Comments

alert-triangle
You must log in or register to comment.

Hacker News@lemmy.bestiver.se

hackernews@lemmy.bestiver.se

Subscribe from Remote Instance

You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !hackernews@lemmy.bestiver.se
lock
Community locked: only moderators can create posts. You can still comment on posts.

Posts from the RSS Feed of HackerNews.

The feed sometimes contains ads and posts that have been removed by the mod team at HN.

Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 148 users / day
  • 1.16K users / week
  • 3.09K users / month
  • 8.09K users / 6 months
  • 1 local subscriber
  • 1.39K subscribers
  • 13K Posts
  • 5.79K Comments
  • Modlog
  • mods:
  • patrick@lemmy.bestiver.se
  • RSS Bot@lemmy.bestiver.se
  • UI: unknown version
  • BE: 0.19.11
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org