Documentation
¶
Overview ¶
Package base62 implements base62 encoding
Index ¶
- Variables
- func DecodeToBigInt(s string) (*big.Int, error)
- func DecodeToInt64(s string) (int64, error)
- func EncodeBigInt(n *big.Int) string
- func EncodeInt64(n int64) string
- func MustDecodeToInt64(s string) int64
- func Padding(n int) option
- type Encoding
- func (e *Encoding) DecodeToBigInt(s string) (*big.Int, error)
- func (e *Encoding) DecodeToInt64(s string) (int64, error)
- func (e *Encoding) EncodeBigInt(n *big.Int) string
- func (e *Encoding) EncodeInt64(n int64) string
- func (e *Encoding) MustDecodeToInt64(s string) int64
- func (e *Encoding) Option(opts ...option) *Encoding
- type ErrInvalidCharacter
Constants ¶
This section is empty.
Variables ¶
var StdEncoding = NewStdEncoding()
StdEncoding is the standard base62 encoding
Functions ¶
func DecodeToBigInt ¶
DecodeToBigInt returns an arbitrary precision integer from the base62 encoded string using the StdEncoding
func DecodeToInt64 ¶
DecodeToInt64 decodes a base62 encoded string using the StdEncoding
func EncodeBigInt ¶
EncodeBigInt returns the base62 encoding of an arbitrary precision integer using the StdEncoding
func EncodeInt64 ¶
EncodeInt64 returns the base62 encoding of n using the StdEncoding
func MustDecodeToInt64 ¶
MustDecodeToInt64 decodes a base62 encoded string using the StdEncoding panics in the case of an error
Types ¶
type Encoding ¶
type Encoding struct {
// contains filtered or unexported fields
}
func NewEncoding ¶
NewEncoding returns a new Encoding defined by the given alphabet
func NewStdEncoding ¶
func NewStdEncoding() *Encoding
NewStdEncoding returns an Encoding preconfigured with the standard base62 alphabet
func (*Encoding) DecodeToBigInt ¶
DecodeToBigInt returns an arbitrary precision integer from the base62 encoded string
func (*Encoding) DecodeToInt64 ¶
DecodeToInt64 decodes a base62 encoded string
func (*Encoding) EncodeBigInt ¶
EncodeBigInt returns the base62 encoding of an arbitrary precision integer
func (*Encoding) EncodeInt64 ¶
EncodeInt64 returns the base62 encoding of n
func (*Encoding) MustDecodeToInt64 ¶
MustDecodeToInt64 decodes a base62 encoded string, it panics in the case of an error
type ErrInvalidCharacter ¶
type ErrInvalidCharacter struct {
// contains filtered or unexported fields
}