Documentation ¶
Index ¶
- func Decode(bz []byte, target interface{}) error
- func DecodeFromHex(str string, target interface{}) error
- func Encode(value interface{}) ([]byte, error)
- func EncodeToHex(value interface{}) (string, error)
- func EncodedLength(value interface{}) (int, error)
- func Eq(one, other interface{}) bool
- func Hex(value interface{}) (string, error)
- func HexDecodeString(s string) ([]byte, error)
- func HexEncodeToString(b []byte) string
- func MustHexDecodeString(str string) []byte
- type Hexer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeFromHex ¶
DecodeFromHex decodes `str` with the scale codec into `target`. `target` should be a pointer.
func Encode ¶
Encode encodes `value` with the scale codec with passed EncoderOptions, returning []byte
func EncodeToHex ¶
EncodeToHex encodes `value` with the scale codec, returning a hex string (prefixed by 0x)
func EncodedLength ¶
EncodedLength returns the length of the value when encoded as a byte array
func Eq ¶
func Eq(one, other interface{}) bool
Eq compares the value of the input to see if there is a match
func HexDecodeString ¶
HexDecodeString decodes bytes from a hex string. Contrary to hex.DecodeString, this function does not error if "0x" is prefixed, and adds an extra 0 if the hex string has an odd length.
func HexEncodeToString ¶
HexEncodeToString encodes bytes to a hex string. Contrary to hex.EncodeToString, this function prefixes the hex string with "0x"
func MustHexDecodeString ¶
MustHexDecodeString panics if str cannot be decoded