crockford constant

Base32Codec const crockford

Codec instance to encode and decode 8-bit integer sequence to 5-bit Base-32 character sequence using the alphabet of Crockford's Base32:

0123456789ABCDEFGHJKMNPQRSTVWXYZ

This alphabet uses additional characters for a mod-37 checksum, and avoid the character U to reduce the likelihood of accidental obscenity.

Decoding is case-insensitive and, following the specification, accepts the ambiguous letters as digits: I, i, L, l decode as 1, and O, o decode as 0. The letter U/u is not part of the alphabet.

It is not padded.

Implementation

static const Base32Codec crockford = Base32Codec._(
  encoder: Base32Encoder(
    alphabet: _base32EncodingCrockford,
  ),
  decoder: Base32Decoder(
    alphabet: _base32DecodingCrockford,
  ),
);