函数示例
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 |
返回的编码数据 |