lowrlp

package
v0.0.0-...-e4e12f0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 License: LGPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package lowrlp provides methods to perform low-level rlp encoding. Codes are mostly copied from github.com/ethereum/go-ethereum/rlp.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encoder

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

Encoder is the low-level rlp encoder.

func (*Encoder) EncodeEmptyList

func (w *Encoder) EncodeEmptyList()

EncodeEmptyList encodes an empty list. It's equivalent to w.ListEnd(w.List()), but more efficient.

func (*Encoder) EncodeEmptyString

func (w *Encoder) EncodeEmptyString()

EncodeEmptyString encodes an empty string. It's equivalent to w.EncodeString(nil), but more efficient.

func (*Encoder) EncodeRaw

func (w *Encoder) EncodeRaw(r []byte)

EncodeRaw encodes raw value.

func (*Encoder) EncodeString

func (w *Encoder) EncodeString(b []byte)

EncodeString encodes the string value.

func (*Encoder) EncodeUint

func (w *Encoder) EncodeUint(i uint64)

EncodeUint encodes the uint value.

func (*Encoder) List

func (w *Encoder) List() int

List starts to encode list elements. It returns the offset which is passed to ListEnd when list ended.

func (*Encoder) ListEnd

func (w *Encoder) ListEnd(index int)

ListEnd ends the list. offset is the return value of the corresponded List call.

func (*Encoder) Reset

func (w *Encoder) Reset()

Reset reset the encoder state.

func (*Encoder) ToBytes

func (w *Encoder) ToBytes() []byte

ToBytes outputs the encode result to byte slice.

func (*Encoder) ToWriter

func (w *Encoder) ToWriter(out io.Writer) (err error)

ToWriter outputs the encode result to io.Writer.

Jump to

Keyboard shortcuts

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