yabase/base32/clockwork

Values

pub fn decode(
  input: String,
) -> Result(BitArray, encoding.CodecError)

Decode a Clockwork Base32 string to a BitArray. Case-insensitive. o/O->0, i/I/l/L->1.

Non-alphabet characters (whitespace, CR/LF, punctuation outside Clockwork’s accepted set) are rejected with InvalidCharacter carrying the offending byte and its position. The alphabet check runs before the length check so the caller does not see a misleading InvalidLength when the real fault is an out-of-alphabet byte.

pub fn encode(data: BitArray) -> String

Encode a BitArray to Clockwork Base32 (no padding).

Search Document