//固定长度字节数组之间的相互转换
pragma solidity ^0.4.0;
contract changeBytes{
bytes9 name = 0xe99988e8af97e5ae9d;
function changeBytes1() view returns(bytes1){
return bytes1(name);
}
function changeBytes2() view returns(bytes2){
return bytes2(name);
}
function changeBytes16() view returns(bytes16){
return bytes16(name);
}
}
7.Solidity-固定长度字节数组之间的相互转换
于 2022-11-06 16:39:23 首次发布
本文介绍了一个使用Solidity编写的智能合约示例,展示了如何将固定长度的字节数组进行不同长度间的相互转换。这包括从较短的字节类型到较长的字节类型的转换方法。
1152

被折叠的 条评论
为什么被折叠?



