crypt.base64decode
Decodes a Base64 string back to raw bytes.
function crypt.base64decode(data: string): stringSynopsis
How it works
Decodes a Base64-encoded string back to raw bytes. Reverses the encoding process: each group of 4 Base64Base64A binary-to-text encoding that represents binary data as ASCII characters. Every 3 bytes become 4 characters from the alphabet A-Z, a-z, 0-9, +, /. Padding with = if input length isn't divisible by 3. characters maps back to 3 bytes of original data:
Base64 chars: S G V s b G 8 =
6-bit values: 18 6 21 44 27 6 60 (pad)
Reassembled: 0x48 0x65 0x6C 0x6C 0x6F
Output: "Hello"
The = padding characters indicate the final group had fewer than 3 bytes. Accepts standard Base64 alphabet (A-Z, a-z, 0-9, +, /).Usage
Decode
print(crypt.base64decode("SGVsbG8sIFdvcmxkIQ==")) "cc">--> Hello, World!Parameters
data string The Base64 string to decode.
Returns
string The decoded raw bytes.
Aliases
crypt.base64.decode, crypt.base64_decode, base64.decode, base64_decode