Now, doesn’t that just sound sexy? No, not really. I hear you.
Alas, I went and built it anyway.
Crockford Base32 lets you encode a number into an alphanumeric string, and back again.
Where it shines is in the character set it uses.
It’s resilient to humans:
- No crazy characters or keyboard gymnastics
- Totally case insensitive
- 0, O and o all decode to the same thing
- 1, I, i, L and l all decode to the same thing
- Doesn’t use U, so a number like 519,571 encodes to FVCK instead
- Optional check digit on the end
It’s great for URLs:
- No funky characters that require special encoding
- No plus, slash or equals symbols like base 64
It handles really big numbers. (Well, my implementation is limited to 18,446,744,073,709,551,615 but you could extend the algorithm even further just by changing the data type from ulong to something even bigger.)
|Number||Encoded||Encoded with optional check digit|
Don’t have too much fun now.