Documentation
¶
Overview ¶
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 )
Variables ¶
This section is empty.
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.
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.
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.
Types ¶
This section is empty.