Documentation
¶
Index ¶
- Constants
- func BytesToAddress(b []byte) types.Address
- func BytesToHash(b []byte) types.Hash
- func Encode(b []byte) string
- func FromHex(s string) []byte
- func HashAlg() hash.Hash
- func HashToBytes(hash types.Hash) []byte
- func HeaderHash(block *types.Block) (hash types.Hash)
- func Hex2Bytes(str string) []byte
- func HexToAddress(s string) types.Address
- func HexToHash(s string) types.Hash
- func Serialize(w io.Writer, f *int64) error
- func TxHash(tx *types.Transaction) (hash types.Hash)
- func WriteUint32(writer io.Writer, val uint32) error
- func WriteUint64(writer io.Writer, val uint64) error
- func WriteVarBytes(writer io.Writer, value []byte) error
- func WriteVarUint(writer io.Writer, value uint64) error
- type DataEntryPrefix
Constants ¶
View Source
const ( // DATA DATA_BLOCK DataEntryPrefix = 0x00 //Block height => block hash key prefix DATA_HEADER = 0x01 //Block hash => block hash key prefix DATA_TRANSACTION = 0x02 //Transction hash = > transaction key prefix HashLength = 32 AddressLength = 20 )
Variables ¶
This section is empty.
Functions ¶
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 HeaderHash ¶
HeaderHash calculate block's hash
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 ¶
type DataEntryPrefix ¶
type DataEntryPrefix byte
Click to show internal directories.
Click to hide internal directories.