Documentation
¶
Index ¶
Constants ¶
View Source
const ( MaxLen8 = 2 MaxLen16 = 3 MaxLen32 = 5 MaxLen64 = 10 )
MaxLenN is the maximum length of a varint-encoded N-bit integer.
View Source
const ( MaxVal9 = maxUint64 >> (1 + iota*7) MaxVal8 MaxVal7 MaxVal6 MaxVal5 MaxVal4 MaxVal3 MaxVal2 MaxVal1 )
MaxValN is the maximum varint-encoded integer that fits in N bytes.
Variables ¶
This section is empty.
Functions ¶
func ProtoTag ¶
ProtoTag decodes a protobuf's field number and wire type pair from buf and returns that value and the number of bytes read (> 0). If an error occurred, n = 0 is returned.
func Uvarint ¶
Uvarint decodes a uint64 from buf and returns that value and the number of bytes read (> 0). If an error occurred, the value is 0 and the number of bytes n is <= 0 meaning:
n == 0: buf too small n < 0: value larger than 64 bits (overflow) and -n is the number of bytes read
func UvarintSize ¶
UvarintSize returns the number of bytes necessary to encode a given uint.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.