varint

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Read

func Read(r io.ByteReader) (uint64, error)

func Uvarint added in v2.1.0

func Uvarint(buf []byte) (uint64, int)

Uvarint decodes a uint64 from buf and returns that value and the number of bytes read (> 0). If an error occurred, the value is 0 and the number of bytes n is <= 0 meaning:

n == 0: buf too small
n  < 0: value larger than 64 bits (overflow)
        and -n is the number of bytes read

Copied from https://github.com/dennwc/varint

func Write

func Write(w io.Writer, val uint64) (int, error)

Types

type Writer

type Writer []byte

func NewWriter

func NewWriter() Writer

func (Writer) Write

func (buf Writer) Write(w io.Writer, val uint64) (int, error)

Jump to

Keyboard shortcuts

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