bin

package
v0.0.0-...-24e5678 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: LGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLength = errors.New("invalid length")
)

util errors

Functions

func Address

func Address(v []byte) common.Address

Amount returns a Amount of the byte array

func Amount

func Amount(v []byte) *amount.Amount

Amount returns a Amount of the byte array

func FillBytes

func FillBytes(r io.Reader, bs []byte) (int64, error)

FillBytes reads bytes from the reader until the given bytes array is filled

func MustWriterToHash

func MustWriterToHash(w io.WriterTo) hash.Hash256

MustWriterToHash return bytes from writer to

func PutUint16

func PutUint16(bs []byte, v uint16)

PutUint16 returns a byte array of the uint16 number

func PutUint32

func PutUint32(bs []byte, v uint32)

Uint32 returns a byte array of the uint32 number

func PutUint64

func PutUint64(bs []byte, v uint64)

Uint64 returns a byte array of the uint64 number

func ReadBool

func ReadBool(r io.Reader) (bool, int64, error)

ReadBool reads a bool using a uint8 from the reader

func ReadBytes

func ReadBytes(r io.Reader) ([]byte, int64, error)

ReadBytes reads a byte array from the reader

func ReadFromBytes

func ReadFromBytes(r io.ReaderFrom, bs []byte) (int64, error)

ReadFromBytes return bytes from writer to

func ReadString

func ReadString(r io.Reader) (string, int64, error)

ReadString reads a string array from the reader

func ReadUint16

func ReadUint16(r io.Reader) (uint16, int64, error)

ReadUint16 reads a uint16 number from the reader

func ReadUint32

func ReadUint32(r io.Reader) (uint32, int64, error)

ReadUint32 reads a uint32 number from the reader

func ReadUint64

func ReadUint64(r io.Reader) (uint64, int64, error)

ReadUint64 reads a uint64 number from the reader

func ReadUint8

func ReadUint8(r io.Reader) (uint8, int64, error)

ReadUint8 reads a uint8 number from the reader

func TypeReadAll

func TypeReadAll(bs []byte, count int) ([]interface{}, error)

func TypeWriteAll

func TypeWriteAll(vs ...interface{}) []byte

func Uint16

func Uint16(v []byte) uint16

Uint16 returns a uint16 number of the byte array

func Uint16Bytes

func Uint16Bytes(v uint16) []byte

Uint16Bytes returns a byte array of the uint16 number

func Uint32

func Uint32(v []byte) uint32

Uint32 returns a uint32 number of the byte array

func Uint32Bytes

func Uint32Bytes(v uint32) []byte

Uint32Bytes returns a byte array of the uint32 number

func Uint64

func Uint64(v []byte) uint64

Uint64 returns a uint64 number of the byte array

func Uint64Bytes

func Uint64Bytes(v uint64) []byte

Uint64Bytes returns a byte array of the uint64 number

func WriteBool

func WriteBool(w io.Writer, b bool) (int64, error)

WriteBool writes the bool using a uint8 to the writer

func WriteBytes

func WriteBytes(w io.Writer, bs []byte) (int64, error)

WriteBytes writes the byte array bytes with the var-length-bytes to the writer

func WriteString

func WriteString(w io.Writer, str string) (int64, error)

WriteString writes the string with the var-length-byte to the writer

func WriteUint16

func WriteUint16(w io.Writer, num uint16) (int64, error)

WriteUint16 writes the uint16 number to the writer

func WriteUint32

func WriteUint32(w io.Writer, num uint32) (int64, error)

WriteUint32 writes the uint32 number to the writer

func WriteUint64

func WriteUint64(w io.Writer, num uint64) (int64, error)

WriteUint64 writes the uint64 number to the writer

func WriteUint8

func WriteUint8(w io.Writer, num uint8) (int64, error)

WriteUint8 writes the uint8 number to the writer

func WriterToBytes

func WriterToBytes(w io.WriterTo) ([]byte, int64, error)

WriterToBytes return bytes from writer to

func WriterToHash

func WriterToHash(w io.WriterTo) (hash.Hash256, int64, error)

WriterToHash return bytes from writer to

Types

type SumReader

type SumReader struct {
	// contains filtered or unexported fields
}

func NewSumReader

func NewSumReader() *SumReader

func (*SumReader) Address

func (sr *SumReader) Address(r io.Reader, p *common.Address) (int64, error)

func (*SumReader) Amount

func (sr *SumReader) Amount(r io.Reader, p **amount.Amount) (int64, error)

func (*SumReader) BigInt

func (sr *SumReader) BigInt(r io.Reader, p **big.Int) (int64, error)

func (*SumReader) Bool

func (sr *SumReader) Bool(r io.Reader, p *bool) (int64, error)

func (*SumReader) Bytes

func (sr *SumReader) Bytes(r io.Reader, p *[]byte) (int64, error)

func (*SumReader) ChainIDVersion

func (sr *SumReader) ChainIDVersion(r io.Reader, chainID **big.Int, version *uint16) (int64, error)

func (*SumReader) GetUint16

func (sr *SumReader) GetUint16(r io.Reader) (uint16, int64, error)

func (*SumReader) GetUint32

func (sr *SumReader) GetUint32(r io.Reader) (uint32, int64, error)

func (*SumReader) GetUint64

func (sr *SumReader) GetUint64(r io.Reader) (uint64, int64, error)

func (*SumReader) GetUint8

func (sr *SumReader) GetUint8(r io.Reader) (uint8, int64, error)

func (*SumReader) Hash256

func (sr *SumReader) Hash256(r io.Reader, p *hash.Hash256) (int64, error)

func (*SumReader) PublicKey

func (sr *SumReader) PublicKey(r io.Reader, p *common.PublicKey) (int64, error)

func (*SumReader) ReaderFrom

func (sr *SumReader) ReaderFrom(r io.Reader, p io.ReaderFrom) (int64, error)

func (*SumReader) Signature

func (sr *SumReader) Signature(r io.Reader, p *common.Signature) (int64, error)

func (*SumReader) String

func (sr *SumReader) String(r io.Reader, p *string) (int64, error)

func (*SumReader) Sum

func (sr *SumReader) Sum() int64

func (*SumReader) Uint16

func (sr *SumReader) Uint16(r io.Reader, p *uint16) (int64, error)

func (*SumReader) Uint32

func (sr *SumReader) Uint32(r io.Reader, p *uint32) (int64, error)

func (*SumReader) Uint64

func (sr *SumReader) Uint64(r io.Reader, p *uint64) (int64, error)

func (*SumReader) Uint8

func (sr *SumReader) Uint8(r io.Reader, p *uint8) (int64, error)

type SumWriter

type SumWriter struct {
	// contains filtered or unexported fields
}

func NewSumWriter

func NewSumWriter() *SumWriter

func (*SumWriter) Address

func (sw *SumWriter) Address(w io.Writer, v common.Address) (int64, error)

func (*SumWriter) Amount

func (sw *SumWriter) Amount(w io.Writer, v *amount.Amount) (int64, error)

func (*SumWriter) BigInt

func (sw *SumWriter) BigInt(w io.Writer, v *big.Int) (int64, error)

func (*SumWriter) Bool

func (sw *SumWriter) Bool(w io.Writer, v bool) (int64, error)

func (*SumWriter) Bytes

func (sw *SumWriter) Bytes(w io.Writer, v []byte) (int64, error)

func (*SumWriter) ChainIDVersion

func (sw *SumWriter) ChainIDVersion(w io.Writer, chainID *big.Int, version uint16) (int64, error)

func (*SumWriter) Hash256

func (sw *SumWriter) Hash256(w io.Writer, v hash.Hash256) (int64, error)

func (*SumWriter) PublicKey

func (sw *SumWriter) PublicKey(w io.Writer, v common.PublicKey) (int64, error)

func (*SumWriter) Signature

func (sw *SumWriter) Signature(w io.Writer, v common.Signature) (int64, error)

func (*SumWriter) String

func (sw *SumWriter) String(w io.Writer, v string) (int64, error)

func (*SumWriter) Sum

func (sw *SumWriter) Sum() int64

func (*SumWriter) Uint16

func (sw *SumWriter) Uint16(w io.Writer, v uint16) (int64, error)

func (*SumWriter) Uint32

func (sw *SumWriter) Uint32(w io.Writer, v uint32) (int64, error)

func (*SumWriter) Uint64

func (sw *SumWriter) Uint64(w io.Writer, v uint64) (int64, error)

func (*SumWriter) Uint8

func (sw *SumWriter) Uint8(w io.Writer, v uint8) (int64, error)

func (*SumWriter) WriterTo

func (sw *SumWriter) WriterTo(w io.Writer, v io.WriterTo) (int64, error)

type TypeReader

type TypeReader struct {
	// contains filtered or unexported fields
}

func (*TypeReader) Sum

func (tr *TypeReader) Sum() int64

type TypeWriter

type TypeWriter struct {
	// contains filtered or unexported fields
}

func NewTypeWriter

func NewTypeWriter() *TypeWriter

func (*TypeWriter) Sum

func (tw *TypeWriter) Sum() int64

func (*TypeWriter) WriteAll

func (tw *TypeWriter) WriteAll(w io.Writer, vs ...interface{}) (int64, error)

Jump to

Keyboard shortcuts

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