Base64编解码函数

更新时间:2024-09-24 01:32:11

函数示例

base64 编解码能力是平台提供的一套编解码规则,主要为验签函数提供签名,其使用示例如下所示:

function test_base64_decode() returns (bool , string memroy)
{
    string memory name = "aHR0cDovL3Rlc3RfYmFzZTY0IH4hQCMkJQ==";
    return base64_decode(name);
}

function test_base64_encode() returns (bool , string memroy)
{
    string memory name = "http://test_base64 ~!@#$%";
    return base64_encode(name);
}

base64_decode

base64_decode 是 base64 解码函数。

函数原型

base64_decode(string data) returns(bool result, string memory data);

请求参数

参数

必选

类型

说明

参数

必选

类型

说明

data

string

要解密的数据

返回值

参数

必选

类型

说明

参数

必选

类型

说明

result

bool

方法返回值,成功为 true,否则为 false

data

string

返回的解码数据

base64_encode

base64_encode 是 base64 编码函数。

函数原型

base64_encode(string data) returns(bool result, string memory data) ;

请求参数

参数

必选

类型

说明

参数

必选

类型

说明

data

string

要加密的数据

返回值

参数

必选

类型

说明

参数

必选

类型

说明

result

bool

方法返回值,成功为 true,否则为 false

data

string

返回的编码数据

  • 本页导读 (0)
  • 函数示例
  • base64_decode
  • 函数原型
  • 请求参数
  • 返回值
  • base64_encode
  • 函数原型
  • 请求参数
  • 返回值
AI助理

点击开启售前

在线咨询服务

你好,我是AI助理

可以解答问题、推荐解决方案等