Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeString ¶
DecodeString parses the given hex string to bytes, it can return error if the hex string is invalid. Follows the semantic of ethereum's FromHex.
func EnsurePrefix ¶
EnsurePrefix adds the prefix (0x) to a given hex string.
func TrimPrefix ¶
TrimPrefix removes the prefix (0x) of a given hex string.
Types ¶
type PlainHexBytes ¶ added in v1.3.0
type PlainHexBytes []byte
PlainHexBytes marshals/unmarshals as a JSON string without a 0x prefix. The empty slice marshals as "".
func (PlainHexBytes) MarshalText ¶ added in v1.3.0
func (b PlainHexBytes) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler
func (PlainHexBytes) String ¶ added in v1.3.0
func (b PlainHexBytes) String() string
func (*PlainHexBytes) UnmarshalJSON ¶ added in v1.3.0
func (b *PlainHexBytes) UnmarshalJSON(input []byte) (err error)
UnmarshalJSON implements json.Unmarshaler.
func (*PlainHexBytes) UnmarshalText ¶ added in v1.3.0
func (b *PlainHexBytes) UnmarshalText(input []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
Click to show internal directories.
Click to hide internal directories.