Documentation ¶
Index ¶
- Variables
- type CorruptInputError
- 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)
- func (enc *Encoding) EncodeToString(src []byte) string
- func (enc *Encoding) EncodedLen(n int) int
Constants ¶
This section is empty.
Variables ¶
var SafeEncoding = NewEncoding(safeAlphabet)
SafeEncoding is a base32768 encoding using only "safe" Unicode runes
var SafeEncodingCI = NewEncoding(safeAlphabetCI)
SafeEncodingCI is a base32768 encoding using only case insensitive "safe" Unicode runes
var ShortEncoding = NewEncoding(shortAlphabet)
ShortEncoding is a base32768 encoding use all codepoint from 0x00C0 - 0x0800 to optimize UTF-8 behavior
Functions ¶
This section is empty.
Types ¶
type CorruptInputError ¶
type CorruptInputError int64
func (CorruptInputError) Error ¶
func (e CorruptInputError) Error() string
type Encoding ¶
type Encoding struct {
// contains filtered or unexported fields
}
An Encoding is a radix 32768 encoding/decoding scheme, defined by a 32768-character alphabet.
func NewEncoding ¶
NewEncoding returns a new Encoding defined by the given alphabet, The alphabet must be a 1028 characters long and contains only BMP character and 32 block leading characters.
func (*Encoding) Decode ¶
Decode decodes src using the encoding enc. It writes at most DecodedLen(len(src)) bytes to dst and returns the number of bytes written. If src contains invalid base32768 data, it will return the number of bytes successfully written and CorruptInputError. New line characters (\r and \n) are ignored.
func (*Encoding) DecodeString ¶
DecodeString returns the bytes represented by the base32768 string s.
func (*Encoding) DecodedLen ¶
DecodedLen returns the maximum length in bytes of the decoded data corresponding to n bytes of base32768-encoded data.
func (*Encoding) Encode ¶
Encode encodes src using the encoding enc, writing EncodedLen(len(src)) bytes to dst.
func (*Encoding) EncodeToString ¶
EncodeToString returns the base32768 encoding of src.
func (*Encoding) EncodedLen ¶
EncodedLen returns the length in bytes of the base32768 encoding of an input buffer of length n.