base62

package
v0.11.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2018 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package base62 provides utilities for working with base62 strings. base62 strings will only contain characters: 0-9, a-z, A-Z

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(input string) []byte

Decode converts input from base62 to its byte representation If the decoding fails, an empty slice is returned.

func Encode

func Encode(buf []byte) string

Encode converts buf into a base62 string

Note: this should only be used for reducing a string's character set range. It is not for use with arbitrary data since leading 0 bytes will be dropped.

func Random

func Random(length int, truncate bool) (string, error)

Random generates a random base62-encoded string. If truncate is true, the result will be a string of the requested length. Otherwise, it will be the encoded result of length bytes of random data.

Types

This section is empty.

Jump to

Keyboard shortcuts

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