base64

Table of Contents

Function

base64 — encode/decode Base64 strings

Synopsis

base64(b: bytes) -> string
base64(s: string) -> bytes

Description

The base64 function encodes a bytes value b as a a Base64 string, or decodes a Base64 string s into a bytes value.

Examples

Encode byte sequence 0x010203 into its Base64 string:

yield base64(this)
0x010203
Loading...

Decode “AQID” into byte sequence 0x010203:

yield base64(this)
"AQID"
Loading...

Encode ASCII string into Base64-encoded string:

yield base64(bytes(this))
"hello,
world"
Loading...

Decode a Base64 string and cast the decoded bytes to a string:

yield string(base64(this))
"aGVsbG8gd29ybGQ="
Loading...
Next: bucket

SuperDB