Where did base32-sortable
come from?
#1706
Replies: 1 comment 1 reply
-
That is a great question! I don't know. You can find this old github issue from last year (Nov 2022, before I worked at Bluesky) talking wiht @AaronGoldman about TIDs. I believe he designed them and could answer. They hew pretty close to Twitter Snowflake identifiers in structure, and assume they were inspired by Snowflakes. Designing compact little identifiers is definitely A Thing in general, and i'd be surprised if the same encoding alphabet isn't being used elsewhere. Proliferation is a bit of a bummer but so it goes. I bet the IETF won't be thrilled when we get there. I overlapped with brandur at a previous job and am a fan of his blog, but I don't think there was any communication there. I just ran in to some quirks with the way we encode TIDs when re-implementing in go recently, will expand on the specs and have some interop test cases soon. Eg, 13 digits of base32 is 65 bits, and the 64bits of data need to be shifted one way or the other; we will stick with how the current typescript code does it, I assume, even thought it doesn't match how some libraries work. |
Beta Was this translation helpful? Give feedback.
-
According to the docs, TIDs are encoded using
base32-sortable
, using the alphabet234567abcdefghijklmnopqrstuvwxyz
.https://atproto.com/specs/record-key#record-key-type-tid
The description here seems reasonably unambiguous, but I am nonetheless curious, where does it come from? Why was that particular alphabet chosen? A google search for "base32-sortable" yields only the atproto docs.
I found this blog post that arrives at the same alphabet, perhaps independently - https://brandur.org/fragments/base32-slugs - although it was published Dec 29, 2022 which is possibly after atproto adopted it? (I have not done any git archeology to find out)
I suppose that blog answers the question of why that specific alphabet - but I'm still curious to know the "etymology" of the design decision in atproto.
Beta Was this translation helpful? Give feedback.
All reactions