Skip to main content

Module base64

Module base64 

Source
Expand description

Minimal standard-alphabet Base64 codec (RFC 4648): encode for embedding image bytes as data: URIs, decode for reading them back out — avoids a dependency for the two things we need.

Functions§

decode
Decode standard-alphabet Base64. Whitespace is ignored and = padding ends the stream; returns None on any other invalid character. Lenient about missing padding (handles the unpadded variant some data: URIs use).
encode
Base64-encode data with = padding.