Documentation ¶
Index ¶
- Constants
- func AddressToHex(addr types.Address) string
- func BytesToAddress(b []byte) types.Address
- func BytesToHash(b []byte) types.Hash
- func Encode(b []byte) string
- func FromHex(s string) []byte
- func HashToBytes(hash types.Hash) []byte
- func HashToHex(h types.Hash) string
- func Hex2Bytes(str string) []byte
- func HexToAddress(s string) types.Address
- func HexToHash(s string) types.Hash
Constants ¶
View Source
const ( HashLength = 32 AddressLength = 20 )
Lengths of hashes and addresses in bytes.
Variables ¶
This section is empty.
Functions ¶
func AddressToHex ¶
AddressToBytes convert address to hex string
func BytesToAddress ¶
BytesToAddress returns Address with value b. If b is larger than len(h), b will be cropped from the left.
func BytesToHash ¶
BytesToHash sets b to hash. If b is larger than len(h), b will be cropped from the left.
func FromHex ¶
FromHex returns the bytes represented by the hexadecimal string s. s may be prefixed with "0x".
func HexToAddress ¶
HexToAddress returns Address with byte values of s. If s is larger than len(h), s will be cropped from the left.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.