dencoding

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2025 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BITMASK = []byte{
	0x01,
	0x03,
	0x07,
	0x0F,
	0x1F,
	0x3F,
	0x7F,
	0xFF,
}

Functions

func DecodeInt

func DecodeInt(vint []byte) int64

DecodeInt decodes the array of bytes and returns a signed 64-bit integer

func DecodeUInt

func DecodeUInt(vint []byte) uint64

DecodeUInt decodes the array of bytes and returns an unsigned 64-bit integer

func DecodeUIntRev

func DecodeUIntRev(vint []byte) uint64

DecodeUIntRev decodes the varint encoded by EncodeUIntRev[InPlace]

func EncodeInt

func EncodeInt(x int64) []byte

EncodeInt encodes the signed 64-bit integer value into a varint and returns an array of bytes (little endian encoded)

func EncodeUInt

func EncodeUInt(x uint64) []byte

EncodeUInt encodes the unsigned 64-bit integer value into a varint and returns an array of bytes (little endian encoded)

func EncodeUIntRevInPlace

func EncodeUIntRevInPlace(x uint64, buf []byte)

EncodeUIntRevInPlace encodes the uint64 value into a reversed-varint in place, produce the same result as slices.Reverse(EncodeUInt(x))

func GetEncodeUIntSize

func GetEncodeUIntSize(x uint64) uint64

GetEncodeUIntSize returns the size in byte the encoded varint will take

Types

This section is empty.

Jump to

Keyboard shortcuts

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