Documentation ¶
Overview ¶
Package base128 implements base128 encoding and decoding.
Encoded results are UTF8-safe, and will retain the same memcmp sorting properties of the input data.
Index ¶
Constants ¶
This section is empty.
Variables ¶
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") )
Functions ¶
func Decode ¶
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.
func DecodeString ¶
DecodeString returns the bytes represented by the base128 string s.
func DecodedLen ¶
DecodedLen returns the number of bytes `encLen` encoded bytes decodes to.
func Encode ¶
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.
func EncodeToString ¶
EncodeToString returns the base128 encoding of src.
func EncodedLen ¶
EncodedLen returns the number of bytes that `dataLen` bytes will encode to.
Types ¶
This section is empty.