Encode a str or bytes value using Base64.
See base64_decode for Base64 decoding.
This function does not generate a change.
base64_encode(string)
Argument | Type | Description |
---|---|---|
string | str/bytes | The value to encode. |
Encoded str value is returned.
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"