Documentation
¶
Overview ¶
Package base24 implements base24 encoding as specified by https://www.kuon.ch/post/2020-02-27-base24/
Index ¶
- Variables
- type Encoding
- func (enc *Encoding) Decode(dst, src []byte) (n int, err error)
- func (enc *Encoding) DecodeString(s string) ([]byte, error)
- func (enc *Encoding) DecodedLen(n int) int
- func (enc *Encoding) Encode(dst, src []byte) error
- func (enc *Encoding) EncodeToString(src []byte) (string, error)
- func (enc *Encoding) EncodedLen(n int) int
Constants ¶
This section is empty.
Variables ¶
var StdEncoding = NewEncoding(encodeStd)
StdEncoding is a base24 encoding with the alphabet defined in https://www.kuon.ch/post/2020-02-27-base24/
Functions ¶
This section is empty.
Types ¶
type Encoding ¶
type Encoding struct {
// contains filtered or unexported fields
}
Encoding Most of the time you want to use StdEncoding, but you can provide a custom alphabet using NewEncoding
func NewEncoding ¶
NewEncoding returns an Encoding defined by the given alphabet, The alphabet must be 24 distinct characters
func (*Encoding) Decode ¶
Decode decodes src into dst. DecodedLen(len(src)) bytes will be written to dst. len(src) must be a multiple of 7. Might return an error when invalid data is given See https://www.kuon.ch/post/2020-02-27-base24/ for details
func (*Encoding) DecodeString ¶
DecodeString returns the bytes represented by the base24 string s.
func (*Encoding) DecodedLen ¶
DecodedLen returns the maximum length in bytes of the decoded data corresponding to n bytes of base24-encoded data.
func (*Encoding) Encode ¶
Encode encodes src into dst. EncodedLen(len(src)) bytes will be written to dst. len(src) must be a multiple of 4. See https://www.kuon.ch/post/2020-02-27-base24/ for details
func (*Encoding) EncodeToString ¶
EncodeToString returns the base24 encoding of src as string
func (*Encoding) EncodedLen ¶
EncodedLen returns the length in bytes of the base24 encoding of an input buffer of length n.