Standard library
Base64
Base64 encode and decode.
Introduction
Base64 encode and decode. Import std/encoding/base64 to bind the module as base64. Call free functions as base64.name(...). Struct methods use a receiver value.
/ std/encoding/base64
This page is the package reference for std/encoding/base64. Private helpers used only by co-located tests are not listed.
Functions
Free functions on base64. Each function has a short description, an example, then parameters and return shape.
encode
Encodes bytes or text as base64. Call form: base64.encode(b).
/ std/encoding/base64
$ s = base64.encode(b"hi")
Parameters: b: bytes or text to encode. Returns: Base64 string.
decode
Decodes base64 text to bytes. Call form: base64.decode(s).
/ std/encoding/base64
$ b = base64.decode("aGk=")Parameters: s: base64 text. Returns: Decoded bytes.