const (
MaxVarintSize = 8 // encoded size in bytes
MaxVarint = (1 << 62) - 1
)
func AppendUint8Bytes(b, v []byte) []byte
AppendUint8Bytes appends a sequence of bytes prefixed by an 8-bit length.
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(b, v []byte) []byte
AppendVarintBytes appends a sequence of bytes prefixed by a variable-length integer length.
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(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(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(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(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(b []byte) (v int64, n int)
ConsumeVarintInt64 parses a variable-length integer as an int64.
func SizeVarint(v uint64) int
SizeVarint returns the size of the variable-length integer encoding of f.