bytes

package
v0.10.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2025 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearBytes

func ClearBytes(b []byte)

func Compare

func Compare(h1, h2 HexBytes) int

func RandBytes

func RandBytes(n int) []byte

func RandHexString

func RandHexString(n int) string

func RandInt64N

func RandInt64N(cap int64) int64

func RandU256Int

func RandU256Int() *uint256.Int

func RandU256IntN

func RandU256IntN(cap *uint256.Int) *uint256.Int

func RandUint64N

func RandUint64N(cap uint64) uint64

func ZeroBytes

func ZeroBytes(n int) []byte

Types

type HexBytes

type HexBytes tmbytes.HexBytes

HexBytes enables HEX-encoding for json/encoding.

func RandHexBytes

func RandHexBytes(n int) HexBytes

func (HexBytes) Array20

func (hb HexBytes) Array20() [20]byte

func (HexBytes) Array32

func (hb HexBytes) Array32() [32]byte

func (HexBytes) Bytes

func (hb HexBytes) Bytes() []byte

Bytes fulfills various interfaces in light-web3, etc...

func (HexBytes) Compare

func (hb HexBytes) Compare(o HexBytes) int

func (HexBytes) Format

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

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) Marshal

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

Marshal needed for protobuf compatibility

func (HexBytes) MarshalJSON

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

This is the point of Bytes.

func (HexBytes) String

func (hb HexBytes) String() string

func (*HexBytes) Unmarshal

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

Unmarshal needed for protobuf compatibility

func (*HexBytes) UnmarshalJSON

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

This is the point of Bytes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL