Documentation
¶
Overview ¶
Package crockford is Douglas Crockford's base32 (https://www.crockford.com/base32.html): the symbols 0-9 and A-Z without I, L, O and U, five bits each, most significant bit first. It has no check symbol; a caller that wants one carries its own.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
Decode returns the bytes s encodes, accepting only what Encode returns: encode symbols alone, no symbol beyond the bytes' last bit, and zero padding bits, so Encode(Decode(s)) == s whenever ok. Run Normalize first for typed input.
func Encode ¶
Encode returns b in encode symbols, most significant bit first, the last symbol padded with zero bits.
func Normalize ¶
Normalize applies Crockford's decode reading to typed input: it removes ASCII '-' and space, folds ASCII a-z to upper case, and maps O and o to 0 and I, i, L and l to 1. Every other rune is kept as it is, so a value holding one never decodes. It folds byte by byte, never with Unicode case mapping, which would turn 'ı' and 'ſ' into ASCII letters and so disagree with a client that folds ASCII alone.
Types ¶
This section is empty.