base62

package module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2025 License: BSD-3-Clause Imports: 3 Imported by: 1

README

Base62 encoding and decoding

CI Go Reference GoReportCard

Installation

go get kkn.fi/base62

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

BSD-3-Clause. See LICENSE for details.

Documentation

Overview

Package base62 implements base62 encoder and decoder.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(s string) (int64, error)

Decode a base62 encoded string to int. Returns an error if input s is not valid base62 literal [0-9a-zA-Z].

Example
i, err := Decode("1B")
fmt.Println(i, err)
Output:

99 <nil>

func Encode

func Encode(n int64) string

Encode decoded integer to base62 string.

Example
fmt.Println(Encode(99))
Output:

1B

Types

This section is empty.

Jump to

Keyboard shortcuts

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