tendermint: github.com/tendermint/tendermint/libs/bytes Index | Files

package bytes

import "github.com/tendermint/tendermint/libs/bytes"


Package Files

bytes.go byteslice.go

func Fingerprint Uses

func Fingerprint(slice []byte) []byte

Fingerprint returns the first 6 bytes of a byte slice. If the slice is less than 6 bytes, the fingerprint contains trailing zeroes.

type HexBytes Uses

type HexBytes []byte

The main purpose of HexBytes is to enable HEX-encoding for json/encoding.

func (HexBytes) Bytes Uses

func (bz HexBytes) Bytes() []byte

Allow it to fulfill various interfaces in light-client, etc...

func (HexBytes) Format Uses

func (bz HexBytes) Format(s fmt.State, verb rune)

func (HexBytes) Marshal Uses

func (bz HexBytes) Marshal() ([]byte, error)

Marshal needed for protobuf compatibility

func (HexBytes) MarshalJSON Uses

func (bz HexBytes) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface. The hex bytes is a quoted hexadecimal encoded string.

func (HexBytes) String Uses

func (bz HexBytes) String() string

func (*HexBytes) Unmarshal Uses

func (bz *HexBytes) Unmarshal(data []byte) error

Unmarshal needed for protobuf compatibility

func (*HexBytes) UnmarshalJSON Uses

func (bz *HexBytes) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Umarshaler interface.

Package bytes imports 5 packages (graph) and is imported by 102 packages. Updated 2020-11-10. Refresh now. Tools for package owners.