Blog Post base32 ID Cleanup
The IDs for posts on this site are generated by using base32b32 encoding to convert timestamps into strings of text. The idea being to get shorter IDs that still sort in chronological order. For example, this timestamp:
2026-07-20T13:27:00-04:00Turns into this snippet:
01n5wpk4It works great, as long as you do the encoding properly. It turns out, Dear Reader, that I did not do it properly.
This is the process I wrote to fix them. It does two things:
-
update the ids in the files based of the
createdtimestamp. -
generates blog folders for the new IDs.
Rust
Measure Twice
I checked the original method I was using to make sure things were sorting properly. Unfortunately, I didn't check all the cases I needed to. The issue only shows up when there are numbers in the output string. The encoding should have put numbers before letters. It didn't. They were reversed.
I considered not bothering with the update. It doesn't matter for the site itself. The only place it makes a difference is when I'm editing files. It's easier to find them when they are sorted by date. The goal of the site builder I'm working on is to use it for the next 20 years. Spending the time on the correction is an easy investment given that perspective.
-a
Endnotes
- I moved the pages to new locations that match their updated IDs. I didn't bother setting up redirects. Incoming links that point to the old locations will get a Page Not Found error. I don't expect that to be enough of a problem that it's worth setting up redirects for.