Documentation ¶
Overview ¶
Package lowrlp provides methods to perform low-level rlp encoding. Codes are mostly copied from github.com/ethereum/go-ethereum/rlp.
Index ¶
- type Encoder
- func (w *Encoder) EncodeEmptyList()
- func (w *Encoder) EncodeEmptyString()
- func (w *Encoder) EncodeRaw(r []byte)
- func (w *Encoder) EncodeString(b []byte)
- func (w *Encoder) EncodeUint(i uint64)
- func (w *Encoder) List() int
- func (w *Encoder) ListEnd(index int)
- func (w *Encoder) Reset()
- func (w *Encoder) ToBytes() []byte
- func (w *Encoder) ToWriter(out io.Writer) (err error)
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) EncodeString ¶
EncodeString encodes the string value.
func (*Encoder) EncodeUint ¶
EncodeUint encodes the uint value.
func (*Encoder) List ¶
List starts to encode list elements. It returns the offset which is passed to ListEnd when list ended.
func (*Encoder) ListEnd ¶
ListEnd ends the list. offset is the return value of the corresponded List call.