yabase/base64/standard

Values

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

Decode a standard Base64 string to a BitArray. Per RFC 4648 section 3.3, non-alphabet characters (including whitespace, CR/LF, and other punctuation) are rejected. The alphabet check runs before the length check so the caller sees InvalidCharacter (with the offending byte and its position) rather than a misleading InvalidLength whenever the real fault is an out-of-alphabet byte.

pub fn encode(data: BitArray) -> String

Encode a BitArray to standard Base64 with padding.

Search Document