Documentation
¶
Overview ¶
This package implements a basic encoder/decoder for Ethereum's Recursive-Length Prefix (RLP) Serialization. For a detailed description of RLP, see Ethereum's page: https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/
Index ¶
- func Encode(input Item) []byte
- type Item
- func Byte(b byte) Item
- func Bytes(b []byte) Item
- func Decode(input []byte) (Item, error)
- func Int(n int) Item
- func List(items ...Item) Item
- func Secp256k1PublicKey(pubk *secp256k1.PublicKey) Item
- func String(s string) Item
- func Time(t time.Time) Item
- func Uint16(n uint16) Item
- func Uint64(n uint64) Item
- func (i Item) At(pos int) Item
- func (i Item) Bytes() []byte
- func (i Item) Bytes32() ([32]byte, error)
- func (i Item) Bytes65() ([65]byte, error)
- func (i Item) Hash() ([32]byte, error)
- func (i Item) IP() (net.IP, error)
- func (i Item) List() []Item
- func (i Item) Secp256k1PublicKey() (*secp256k1.PublicKey, error)
- func (i Item) String() string
- func (i Item) Time() time.Time
- func (i Item) Uint16() uint16
- func (i Item) Uint64() uint64
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Item ¶
type Item struct {
// contains filtered or unexported fields
}
Instead of using standard data types and reflection this package chooses to encode Items. Set d or l but not both. l is a list of Item for arbitrarily nested lists. d is the data payload for the item.
func Secp256k1PublicKey ¶
func Secp256k1PublicKey(pubk *secp256k1.PublicKey) Item
Uncompressed secpk256k1 public key
func (Item) Secp256k1PublicKey ¶
Click to show internal directories.
Click to hide internal directories.