base62

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2022 License: BSD-2-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// StdEncoding base62 standard encoder.
	StdEncoding = MustNewEncoder(StdSource())
)

Functions

func StdSource

func StdSource() string

StdSource returns base62 standard source string.

Types

type Encoder

type Encoder struct {
	// contains filtered or unexported fields
}

Encoder base62 encoder.

func MustNewEncoder

func MustNewEncoder(source string) *Encoder

MustNewEncoder must new a base62 encoder.

func NewEncoder

func NewEncoder(source string) (*Encoder, error)

NewEncoder new a base62 encoder.

func (*Encoder) Decode

func (enc *Encoder) Decode(id string) (int64, error)

Decode base62 decodes a string id.

func (*Encoder) Encode

func (enc *Encoder) Encode(id int64) string

Encode base62 encodes a int64 id.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL