文档

Base64编解码函数

更新时间:

函数示例

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

  1. function test_base64_decode() returns (bool , string memroy)
  2. {
  3. string memory name = "aHR0cDovL3Rlc3RfYmFzZTY0IH4hQCMkJQ==";
  4. return base64_decode(name);
  5. }
  6. function test_base64_encode() returns (bool , string memroy)
  7. {
  8. string memory name = "http://test_base64 ~!@#$%";
  9. return base64_encode(name);
  10. }

base64_decode

base64_decode 是 base64 解码函数。

函数原型

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

请求参数

参数 必选 类型 说明
data string 要解密的数据

返回值

参数 必选 类型 说明
result bool 方法返回值,成功为 true,否则为 false
data string 返回的解码数据

base64_encode

base64_encode 是 base64 编码函数。

函数原型

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

请求参数

参数 必选 类型 说明
data string 要加密的数据

返回值

参数 必选 类型 说明
result bool 方法返回值,成功为 true,否则为 false
data string 返回的编码数据
  • 本页导读 (0)
文档反馈