varint

package
v0.0.0-...-d1df60a Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: MPL-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

View Source
const MaxVarintLen = 10

MaxVarintLen is the maximum number of bytes required to encode a varint number.

Variables

This section is empty.

Functions

func Decode

func Decode(b []byte) (int64, int)

Decode reads the first varint encoded number from the given buffer.

On success, the function returns the varint as an int64, and the number of bytes read (0 if there was an error).

func Encode

func Encode(b []byte, value int64) int

Encode encodes the given value to varint format.

Types

This section is empty.

Jump to

Keyboard shortcuts

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