package quicwire
import "golang.org/x/net/internal/quic/quicwire"
Package quicwire encodes and decode QUIC/HTTP3 wire encoding types, particularly variable-length integers.
Index ¶
- Constants
- func AppendUint8Bytes(b, v []byte) []byte
- func AppendVarint(b []byte, v uint64) []byte
- func AppendVarintBytes(b, v []byte) []byte
- func ConsumeUint32(b []byte) (uint32, int)
- func ConsumeUint64(b []byte) (uint64, int)
- func ConsumeUint8Bytes(b []byte) ([]byte, int)
- func ConsumeVarint(b []byte) (v uint64, n int)
- func ConsumeVarintBytes(b []byte) ([]byte, int)
- func ConsumeVarintInt64(b []byte) (v int64, n int)
- func SizeVarint(v uint64) int
Constants ¶
const ( MaxVarintSize = 8 // encoded size in bytes MaxVarint = (1 << 62) - 1 )
Functions ¶
func AppendUint8Bytes ¶
AppendUint8Bytes appends a sequence of bytes prefixed by an 8-bit length.
func AppendVarint ¶
AppendVarint appends a variable-length integer to b.
https://www.rfc-editor.org/rfc/rfc9000.html#section-16
func AppendVarintBytes ¶
AppendVarintBytes appends a sequence of bytes prefixed by a variable-length integer length.
func ConsumeUint32 ¶
ConsumeUint32 parses a 32-bit fixed-length, big-endian integer, reporting its length. It returns a negative length upon an error.
func ConsumeUint64 ¶
ConsumeUint64 parses a 64-bit fixed-length, big-endian integer, reporting its length. It returns a negative length upon an error.
func ConsumeUint8Bytes ¶
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 ¶
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 ¶
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 ¶
consumeVarintInt64 parses a variable-length integer as an int64.
func SizeVarint ¶
SizeVarint returns the size of the variable-length integer encoding of f.
Source Files ¶
wire.go
- Version
- v0.35.0 (latest)
- Published
- Feb 10, 2025
- Platform
- linux/amd64
- Imports
- 1 packages
- Last checked
- 6 hours ago –
Tools for package owners.