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.
BufLen returns the number of bytes required to encode x.
This must be used when passing buffers to Put.
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.
Encode x as into a new byte with length BufLen(x).
Use Put to control the allocation of the slice.
Put the encoding of x into buf, which must be exactly equal to BufLen(x). For example,
If len(buf) is not exactly equal to BufLen(x), garbage data will be written into buf.