Encodings

Crockford's Base32

Base32 for people without I and L and O and U. Decoding forgives look-alikes and hyphens
IDbase32-crockford05 / 20base32 · 32 characters
Encoding / Base32

Crockford's Base32

Base32 for people: no I, L, O or U to misread.

Overhead
+60% on random bytes
Padding
none
Standard
Douglas Crockford, Base32 (crockford.com/base32.html)
Used by
ULID
family 4 / 20

Sample

Out
D1JPRV3F41VPYWKCCGGG
Back
"hello world!"

Access

Importimport { base32crockford } from "@agntn/encodings/base32"
CLIencodings encode base32-crockford 'hello world!'
Tryplayground with the sample above
Kinbase32, base32hex, z-base-32

Douglas Crockford's take on base32. No I, L, O or U. Nothing reads as something else. And nothing spells a rude word by accident, which is why U had to go. ULIDs use this alphabet.

ts
encode("base32-crockford", "foobar");  // "CSQPYRK1E8"
decode("base32-crockford", "csqp-yrki-e8");
// the same six bytes: lowercase, hyphens, and i read as 1

Decoding ignores case and hyphens. It reads O as 0 and I or L as 1. Lenient? No, that's the spec. This is the byte encoding. Crockford also defines a number encoding with a check symbol, which isn't here.