base64_encode

Encode a str or bytes value using Base64.

See base64_decode for Base64 decoding.

This function does not generate a change.

Function

base64_encode(string)

Arguments

Argument Type Description
string str/bytes The value to encode.

Return value

Encoded str value is returned.

Example

This code shows an example for base64_encode:

encoded = base64_encode('base64 encoded string');

// result is of type str
assert(type(encoded) == 'str');

// return
encoded;

Return value in JSON format

"YmFzZTY0IGVuY29kZWQgc3RyaW5n"