A script language of time-sharing scheduling coroutine in single thread
b = Import('base64');
b.base64(data, op);
Input:
data
- string type value.op
- a string value to indicate function to encode or decode. It only has two values: encode
and decode
.Return value:
Error:
Example:
b = Import('base64');
sys = Import('sys');
text = 'base64 test';
encoded = b.base64(text, 'encode');
sys.print(encoded);
sys.print(b.base64(encoded, 'decode'));
The output is:
YmFzZTY0IHRlc3Q=
base64 test