Package base128 implements base128 encoding and decoding.
Encoded results are UTF8-safe, and will retain the same memcmp sorting properties of the input data.
var ( // ErrLength is returned from the Decode* methods if the input has an // impossible length. ErrLength = errors.New("base128: invalid length base128 string") // ErrBit is returned from the Decode* methods if the input has a byte with // the high-bit set (e.g. 0x80). This will never be the case for strings // produced from the Encode* methods in this package. ErrBit = errors.New("base128: high bit set in base128 string") )
Decode decodes src into DecodedLen(len(src)) bytes, returning the actual number of bytes written to dst.
If Decode encounters invalid input, it returns an error describing the failure.
DecodeString returns the bytes represented by the base128 string s.
DecodedLen returns the number of bytes `encLen` encoded bytes decodes to.
Encode encodes src into EncodedLen(len(src)) bytes of dst. As a convenience, it returns the number of bytes written to dst, but this value is always EncodedLen(len(src)).
Encode implements base128 encoding.
EncodeToString returns the base128 encoding of src.
EncodedLen returns the number of bytes that `dataLen` bytes will encode to.