-
函数定义
fn base64Encode(text) cls("android.util.Base64", Base64) java(bytes, text, "String.getBytes") javags(DEFAULT, null, Base64, "DEFAULT") javax(result, null, Base64, "encodeToString", "byte[]", bytes, "int", DEFAULT) sss return = result end fn fn base64Decode(text) cls("android.util.Base64", Base64) javags(DEFAULT, null, Base64, "DEFAULT") javax(bytes, null, Base64, "decode", "String", text, "int", DEFAULT) javanew(result, "String", "byte[]", bytes) sss return = result end fn
-
使用示例
fn base64Encode("Hello World") // 打印 SGVsbG8gV29ybGQ= syso(sss.return) fn base64Decode("SGVsbG8gV29ybGQ=") // 打印 Hello World syso(sss.return)