Skip to main content

Module alphabet

Module alphabet 

Source
Expand description

Provides Alphabet and constants for alphabets commonly used in the wild.

Structsยง

Alphabet
An alphabet defines the 64 ASCII characters (symbols) used for base64.
Symbol
An ASCII printable byte suitable for use as a base64 symbol in an alphabet or as custom padding.

Enumsยง

ParseAlphabetError
Possible errors when constructing an Alphabet from a str.

Constantsยง

ALPHABET_LEN ๐Ÿ”’
Unsurprisingly, there are 64 symbols in a Base64 alphabet.
BCRYPT
The bcrypt alphabet.
BIN_HEX
The alphabet used in BinHex 4.0 files.
CRYPT
The crypt(3) alphabet (with . and / as the first two characters).
IMAP_MUTF7
The alphabet used in IMAP-modified UTF-7 (with + and ,).
PADDING_SYMBOL ๐Ÿ”’
Pad symbol for non-weird alphabets.
STANDARD
The standard alphabet (with + and /) specified in RFC 4648.
URL_SAFE
The URL-safe alphabet (with - and _) specified in RFC 4648.

Functionsยง

is_valid_b64_symbol ๐Ÿ”’
Must be ascii printable. 127 (DEL) is commonly considered printable for some reason but clearly unsuitable for base64.