Documentation ¶
Overview ¶
Package types defines common types.
Index ¶
Constants ¶
const Bytes20Size = 20
Bytes20Size is the size of a 20-byte long byte array.
const Bytes32Size = 32
Bytes32Size is the size of a 32-byte long byte array.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bytes20 ¶
type Bytes20 [Bytes20Size]byte
Bytes20 is a 20-byte long byte array.
func NewBytes20FromString ¶
NewBytes20FromString creates a Bytes20 from a hex encoded string.
func (*Bytes20) MarshalJSON ¶
MarshalJSON implements encoding/json.Marshaler.MarshalJSON.
func (*Bytes20) Reverse ¶
func (b *Bytes20) Reverse(rb *ReversedBytes20)
Reverse reverses the bytes order.
func (*Bytes20) UnmarshalJSON ¶
UnmarshalJSON implements encoding/json.Unmarshaler.UnmarshalJSON.
type Bytes32 ¶
type Bytes32 [Bytes32Size]byte
Bytes32 is a 32-byte long byte array.
func NewBytes32FromString ¶
NewBytes32FromString creates a Bytes32 from a hex encoded string.
func (*Bytes32) MarshalJSON ¶
MarshalJSON implements encoding/json.Marshaler.MarshalJSON.
func (*Bytes32) Reverse ¶
func (b *Bytes32) Reverse(rb *ReversedBytes32)
Reverse reverses the bytes order.
func (*Bytes32) UnmarshalJSON ¶
UnmarshalJSON implements encoding/json.Unmarshaler.UnmarshalJSON.
type ReversedBytes20 ¶
type ReversedBytes20 [Bytes20Size]byte
ReversedBytes20 is a 20-byte long byte reversed array. While the bytes are reversed, the hex encoded strings are not.
func NewReversedBytes20FromString ¶
func NewReversedBytes20FromString(src string) (*ReversedBytes20, error)
NewReversedBytes20FromString creates a ReversedBytes20 from a hex encoded string.
func (*ReversedBytes20) MarshalJSON ¶
func (rb *ReversedBytes20) MarshalJSON() ([]byte, error)
MarshalJSON implements encoding/json.Marshaler.MarshalJSON.
func (*ReversedBytes20) Reverse ¶
func (rb *ReversedBytes20) Reverse(b *Bytes20)
Reverse reverses the bytes order.
func (*ReversedBytes20) String ¶
func (rb *ReversedBytes20) String() string
String returns a hex encoded string.
func (*ReversedBytes20) UnmarshalJSON ¶
func (rb *ReversedBytes20) UnmarshalJSON(data []byte) error
UnmarshalJSON implements encoding/json.Unmarshaler.UnmarshalJSON.
func (*ReversedBytes20) Unstring ¶
func (rb *ReversedBytes20) Unstring(src string) error
Unstring sets the value from a hex encoded string.
type ReversedBytes32 ¶
type ReversedBytes32 [Bytes32Size]byte
ReversedBytes32 is a 32-byte long byte reversed array. While the bytes are reversed, the hex encoded strings are not.
func NewReversedBytes32FromString ¶
func NewReversedBytes32FromString(src string) (*ReversedBytes32, error)
NewReversedBytes32FromString creates a ReversedBytes32 from a hex encoded string.
func (*ReversedBytes32) MarshalJSON ¶
func (rb *ReversedBytes32) MarshalJSON() ([]byte, error)
MarshalJSON implements encoding/json.Marshaler.MarshalJSON.
func (*ReversedBytes32) Reverse ¶
func (rb *ReversedBytes32) Reverse(b *Bytes32)
Reverse reverses the bytes order.
func (*ReversedBytes32) String ¶
func (rb *ReversedBytes32) String() string
String returns a hex encoded string.
func (*ReversedBytes32) UnmarshalJSON ¶
func (rb *ReversedBytes32) UnmarshalJSON(data []byte) error
UnmarshalJSON implements encoding/json.Unmarshaler.UnmarshalJSON.
func (*ReversedBytes32) Unstring ¶
func (rb *ReversedBytes32) Unstring(src string) error
Unstring sets the value from a hex encoded string.