Module base64

Source
Expand description

Decoding and encoding of Base 64.

The Base 64 encoding is defined in RFC 4648. There are two variants defined in the RFC, dubbed base64 and base64url which are differenciated by the last two characters in the alphabet. The DNS uses only the original base64 variant, so this is what is implemented by the module for now.

The module defines the type Decoder which keeps the state necessary for decoding. The various functions offered use such a decoder to decode and encode octets in various forms.

Structs§

Decoder
A base 64 decoder.
SymbolConverter
A Base 64 decoder that can be used as a converter with a scanner.

Enums§

DecodeError
An error happened while decoding a base 64 or base 32 encoded string.

Functions§

decode
Decodes a string with base64 encoded data.
display
Encodes binary data in base64 and writes it into a format stream.
encode_display
Returns a placeholder value that implements Display for encoded data.
encode_string
Encodes binary data in base64 and returns the encoded data as a string.