January 13, 2026
Two IDs, one meltdown
Every GitHub Object Has Two IDs
Dev cracks GitHub’s secret code; internet argues if it’s genius or a ticking time bomb
TLDR: A developer decoded GitHub’s fancy ID to pull the real link number, dodging a massive data migration. Commenters split: some celebrate the clever hack, others warn it’s risky to rely on hidden formats, raising the bigger question of how APIs should keep identifiers stable and simple.
GitHub has two ways to label stuff: a fancy global code (from its GraphQL API) and a plain number used in web links. One engineer hit a wall when his links broke, then pulled a full-on CSI: GitHub—decoding the fancy code and grabbing the last 32 bits to reveal the real number. Cue confetti: no database migration, just a tiny bitmask trick. Then it got spicier: old repos like torvalds/linux showed an older, human-readable pattern, making it feel like archaeology in the world’s biggest code museum.
Comments exploded. Some cheered the hacker energy—“find the pattern, ship the feature.” Others warned this is how you get paged at 3 a.m. when GitHub changes the format. chatmasta pushed the GraphQL gospel: objects store IDs however they want and the GraphQL layer wraps it. haileys spotted a “classic length prefix” in the old IDs, nerds swooned. agwa threw cold water: treat IDs as opaque or you’re building on quicksand. Meanwhile ezyang joked that Opus 4.5 already auto-writes the decoder, and phibz preached best practice: hide your simple numbers behind messy strings. Memes? “Two IDs walk into a repo,” “Indiana Jones and the Last Bitmask,” and “please don’t ship the bitmask, future me is crying.”
Key Points
- •GitHub uses two ID systems: base64-encoded GraphQL node IDs and integer database IDs used in URLs.
- •Decoding the base64 portion of a node ID yields a 96-bit integer whose lower 32 bits equal the database ID.
- •A bitmask operation on the decoded node ID reliably extracts the database ID, avoiding data migration.
- •Observed increments in decoded node IDs matched corresponding database ID increments across examples.
- •Older repositories (e.g., torvalds/linux) return node IDs that decode to structured text indicating object type and database ID.