While rebuilding my photo portfolio in Astro, I fell into a rabbit hole: how do you give photos short, clean web links without any two ever clashing? 📸
Turns out, a 10-character ID seems safe until probability kicks in – at 100k photos, the chance of a duplicate is 1 in 188.
By hashing the filename and timestamp into 16 lowercase letters, the odds of a duplicate drop to 1 in 16 trillion (40,000× rarer than winning the lottery).
Completely over-engineered, but bulletproof forever. ✨