Documentation ¶
Overview ¶
Package varintf implements Factom's varInt_F specification.
The varInt_F specifications uses the top bit (0x80) in each byte as the continuation bit. If this bit is set, continue to read the next byte. If this bit is not set, then this is the last byte. The remaining 7 bits are the actual data of the number. The bytes are ordered big endian, unlike the varInt used by protobuf or provided by package encoding/binary.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BufLen ¶
BufLen returns the number of bytes required to encode x.
This must be used when passing buffers to Put.
Put(buf[:BufLen(x)], x)
func Decode ¶
Decode buf into uint64 and return the number of bytes used.
If buf encodes a number larger than 64 bits, 0 and -1 is returned.
Types ¶
This section is empty.