Documentation ¶
Overview ¶
Package git85 implements the radix 85 data encoding used in the Git version control system.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
Decode decodes src into at most MaxDecodedLen(len(src)) bytes, returning the actual number of bytes written to dst.
If Decode encounters invalid input, it returns a CorruptInputError.
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 the radix 85 encoding used in the Git version control tool.
The encoding splits src into chunks of at most 52 bytes and encodes each chunk on its own line.
func EncodedLen ¶
EncodedLen returns the length of an encoding of n source bytes.
func MaxDecodedLen ¶
func NewDecoder ¶
NewDecoder returns a new Git base85 stream decoder.
func NewEncoder ¶
func NewEncoder(w io.Writer) io.WriteCloser
NewEncoder returns a new Git base85 stream encoder. Data written to the returned writer will be encoded and then written to w. The Git encoding operates on 52-byte blocks; when finished writing, the caller must Close the returned encoder to flush any partially written blocks.
Types ¶
type CorruptInputError ¶
type CorruptInputError int64
func (CorruptInputError) String ¶
func (e CorruptInputError) String() string