Skip to content

std/base64

std/base64 — RFC 4648 (standard alphabet) base64 encode / decode. base64_encode(s) / base64_decode(s) — round-trip content-preserving on raw bytes. Encode emits = padding to align to a 4-character group. Decode terminates at the first non-base64 character (so trailing = padding works without special handling), preserving the bytes successfully decoded up to that point. Migrated from the auto-injected prelude per docs/PRELUDE-TO-MODULES.md.

pub function base64_encode(s: string): string
pub function base64_decode(s: string): string