7 characters in base32 (35 bits) is enough to count the milliseconds in a year.

So I could theoretically make a timestamp that looks like:


That's pretty usable for autogenerated urls, don't you think?

(These fun facts brought to you by thinking about pleromas new flake id system and ideas seen on rustodon's issue tracker)

@zatnosk oh hey I like that

The only potential issue is if you've got multiple machines or threads using the same system in which case you'll want at least one randomly generated character at the end to minimize potential conflicts

@zatnosk although... hrm I'm not sure what degree of time precision you need for expected loads


@InspectorCaracal yeah, but this is just the timestamp. Pleromas flake id's use 64bit timestamp + 48 bit worker id + 16 bit counter

I'm thinking add 5 characters with the rest of that, then you have 25 bits to share between workers ids and counter. I think that'll probably be enough for a small system (like a fediverse instance with <10k users.)

Sign in to participate in the conversation

Private mastodon server run by Zatnosk