base62

package module
v0.0.0-...-d6eb69b Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2018 License: BSD-3-Clause Imports: 3 Imported by: 0

README

Base62 encoding and decoding

Build Status GoDoc

Installation

go get kkn.fi/base62
Requirements
  • Go 1.9

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