quicwire

package
v0.37.0 Latest Latest
Warning

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

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

Documentation

Overview

Package quicwire encodes and decode QUIC/HTTP3 wire encoding types, particularly variable-length integers.

Index

Constants

View Source
const (
	MaxVarintSize = 8 // encoded size in bytes
	MaxVarint     = (1 << 62) - 1
)

Variables

This section is empty.

Functions

func AppendUint8Bytes

func AppendUint8Bytes(b, v []byte) []byte

AppendUint8Bytes appends a sequence of bytes prefixed by an 8-bit length.

func AppendVarint

func AppendVarint(b []byte, v uint64) []byte

AppendVarint appends a variable-length integer to b.

https://www.rfc-editor.org/rfc/rfc9000.html#section-16

func AppendVarintBytes

func AppendVarintBytes(b, v []byte) []byte

AppendVarintBytes appends a sequence of bytes prefixed by a variable-length integer length.

func ConsumeUint32

func ConsumeUint32(b []byte) (uint32, int)

ConsumeUint32 parses a 32-bit fixed-length, big-endian integer, reporting its length. It returns a negative length upon an error.

func ConsumeUint64

func ConsumeUint64(b []byte) (uint64, int)

ConsumeUint64 parses a 64-bit fixed-length, big-endian integer, reporting its length. It returns a negative length upon an error.

func ConsumeUint8Bytes

func ConsumeUint8Bytes(b []byte) ([]byte, int)

ConsumeUint8Bytes parses a sequence of bytes prefixed with an 8-bit length, reporting the total number of bytes consumed. It returns a negative length upon an error.

func ConsumeVarint

func ConsumeVarint(b []byte) (v uint64, n int)

ConsumeVarint parses a variable-length integer, reporting its length. It returns a negative length upon an error.

https://www.rfc-editor.org/rfc/rfc9000.html#section-16

func ConsumeVarintBytes

func ConsumeVarintBytes(b []byte) ([]byte, int)

ConsumeVarintBytes parses a sequence of bytes preceded by a variable-length integer length, reporting the total number of bytes consumed. It returns a negative length upon an error.

func ConsumeVarintInt64

func ConsumeVarintInt64(b []byte) (v int64, n int)

consumeVarintInt64 parses a variable-length integer as an int64.

func SizeVarint

func SizeVarint(v uint64) int

SizeVarint returns the size of the variable-length integer encoding of f.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳