Documentation ¶
Index ¶
- func Concat(src ...[]byte) []byte
- func FromI08(val int8) []byte
- func FromI16(val int16) []byte
- func FromI32(val int32) []byte
- func FromI64(val int64) []byte
- func FromU08(val uint8) []byte
- func FromU16(val uint16) []byte
- func FromU32(val uint32) []byte
- func FromU64(val uint64) []byte
- func ToHexString(src []byte, lim int) (dst string)
- func ToI08(val []byte) int8
- func ToI16(val []byte) int16
- func ToI32(val []byte) int32
- func ToI64(val []byte) int64
- func ToU08(val []byte) uint8
- func ToU16(val []byte) uint16
- func ToU32(val []byte) uint32
- func ToU64(val []byte) uint64
- type HexBytes
- func (bz HexBytes) Bytes() []byte
- func (bz HexBytes) Format(s fmt.State, verb rune)
- func (bz HexBytes) Marshal() ([]byte, error)
- func (bz HexBytes) MarshalJSON() ([]byte, error)
- func (bz HexBytes) String() string
- func (bz *HexBytes) Unmarshal(data []byte) error
- func (bz *HexBytes) UnmarshalJSON(data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToHexString ¶
ToHexString convert a `src` to string and intercept the first n characters. If `lim` is 0, there is no limits.
Types ¶
type HexBytes ¶
type HexBytes []byte
HexBytes enables HEX-encoding for json/encoding.
func (HexBytes) Format ¶
Format writes either address of 0th element in a slice in base 16 notation, with leading 0x (%p), or casts HexBytes to bytes and writes as hexadecimal string to s.
func (HexBytes) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface. The encoding is a JSON quoted string of hexadecimal digits.
func (*HexBytes) UnmarshalJSON ¶
UnmarshalJSON implements the json.Umarshaler interface.
Click to show internal directories.
Click to hide internal directories.