encoding

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeBytes

func DecodeBytes(bz []byte) ([]byte, int, error)

decodeBytes decodes a varint length-prefixed byte slice, returning it along with the number of input bytes read.

func DecodeUvarint

func DecodeUvarint(bz []byte) (uint64, int, error)

decodeUvarint decodes a varint-encoded unsigned integer from a byte slice, returning it and the number of bytes decoded.

func DecodeVarint

func DecodeVarint(bz []byte) (int64, int, error)

decodeVarint decodes a varint-encoded integer from a byte slice, returning it and the number of bytes decoded.

func EncodeBytes

func EncodeBytes(w io.Writer, bz []byte) error

EncodeBytes writes a varint length-prefixed byte slice to the writer.

func EncodeBytesSize

func EncodeBytesSize(bz []byte) int

encodeBytesSize returns the byte size of the given slice including length-prefixing.

func EncodeBytesSlice

func EncodeBytesSlice(bz []byte) ([]byte, error)

encodeBytesSlice length-prefixes the byte slice and returns it.

func EncodeUvarint

func EncodeUvarint(w io.Writer, u uint64) error

EncodeUvarint writes a varint-encoded unsigned integer to an io.Writer.

func EncodeUvarintSize

func EncodeUvarintSize(u uint64) int

EncodeUvarintSize returns the byte size of the given integer as a varint.

func EncodeVarint

func EncodeVarint(w io.Writer, i int64) error

EncodeVarint writes a varint-encoded integer to an io.Writer.

func EncodeVarintSize

func EncodeVarintSize(i int64) int

EncodeVarintSize returns the byte size of the given integer as a varint.

Types

This section is empty.

Jump to

Keyboard shortcuts

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