Documentation ¶
Index ¶
- Constants
- func AddressToBig(addr types.Address) *big.Int
- func BigToAddress(b *big.Int) types.Address
- func BigToHash(b *big.Int) types.Hash
- func BytesToAddress(b []byte) types.Address
- func BytesToHash(b []byte) types.Hash
- func Encode(b []byte) string
- func FromHex(s string) []byte
- func HashToBig(hash types.Hash) *big.Int
- func HashToBytes(hash types.Hash) []byte
- func Hex2Bytes(str string) []byte
- func HexToAddress(s string) types.Address
- func HexToHash(s string) types.Hash
Constants ¶
const ( HashLength = 32 AddressLength = 20 )
Lengths of hashes and addresses in bytes.
Variables ¶
This section is empty.
Functions ¶
func AddressToBig ¶
Big converts an address to a big integer.
func BigToAddress ¶
BigToAddress returns Address with byte values of b. If b is larger than len(h), b will be cropped from the left.
func BigToHash ¶
BigToHash sets byte representation of b to hash. If b is larger than len(h), b will be cropped from the left.
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.