Documentation
¶
Index ¶
- Variables
- func AppendInt(dst []byte, num int64) []byte
- func AppendUint(dst []byte, num uint64) []byte
- func DecodeBytes(src []byte) ([]byte, error)
- func DecodeString(src string) ([]byte, error)
- func EncodeToBytes(src []byte) []byte
- func EncodeToString(src []byte) string
- func FormatInt(num int64) []byte
- func FormatUint(num uint64) []byte
- func ParseInt(src []byte) (int64, error)
- func ParseUint(src []byte) (uint64, error)
- type CorruptInputError
- type Encoding
- func (enc *Encoding) AppendInt(dst []byte, num int64) []byte
- func (enc *Encoding) AppendUint(dst []byte, num uint64) []byte
- func (enc *Encoding) Decode(dest, src []byte) (int, error)
- func (enc *Encoding) DecodeString(s string) ([]byte, error)
- func (enc *Encoding) Encode(dest, src []byte) int
- func (enc *Encoding) EncodeToString(src []byte) string
- func (enc *Encoding) FormatInt(num int64) []byte
- func (enc *Encoding) FormatUint(num uint64) []byte
- func (enc *Encoding) ParseInt(src []byte) (int64, error)
- func (enc *Encoding) ParseUint(src []byte) (uint64, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var StdEncoding = NewEncoding(encodeStd)
StdEncoding is an encoding/decoding scheme consisting of [A-Za-z0-9].
Functions ¶
func AppendUint ¶
func DecodeBytes ¶ added in v0.3.0
Decode decodes src using StdEncoding.
func DecodeString ¶
Decode decodes src using StdEncoding.
func EncodeToBytes ¶ added in v0.3.0
EncodeToBytes encodes src using StdEncoding.
func EncodeToString ¶
EncodeToString encodes src using StdEncoding.
func FormatUint ¶
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 62 encoding/decoding scheme, defined by a 62-character alphabet.
func NewEncoding ¶
NewEncoding returns a new padded Encoding defined by the given alphabet. It will panic if the alphabet is not 62 bytes long.
func (*Encoding) DecodeString ¶
DecodeString returns the bytes represented by the base62 string s.
func (*Encoding) EncodeToString ¶
EncodeToString returns the encoding of src.
func (*Encoding) FormatUint ¶
Click to show internal directories.
Click to hide internal directories.