KemalIdentity::MFA::Base32
RFC 4648 base32, because every authenticator app expects a TOTP secret in it.
Not a general-purpose codec and not exported as one: it exists because otpauth:// URIs
and the "type this code in by hand" fallback both speak base32, and Crystal's stdlib ships
base64 only. The alphabet is case-insensitive on the way in — a person reading a secret off
a screen types it in whatever case they like — and upper-case on the way out.
Constants
Class methods
The bytes value encodes, or nil when it is not base32.
Returns nil rather than raising: the input is usually something a person typed, so
"that is not a valid secret" is an expected answer and not an exceptional one. Spaces and
hyphens are ignored, since secrets are printed in groups of four to be readable, and =
padding is accepted although never produced.