nanoid

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Credit: https://github.com/matoous/go-nanoid Credit: https://github.com/ai/nanoid

Index

Constants

This section is empty.

Variables

View Source
var (
	AlphabetDefault = []rune("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
	AlphabetBase64  = []rune("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")
	AlphabetHex     = []rune("0123456789abcdef")
	AlphabetAscii85 = []rune("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~")
)

defaultAlphabet is the alphabet used for ID characters by default.

Functions

func Generate

func Generate(alphabet string, size int) string

Generate is a low-level function to change alphabet and ID size.

func New

func New(size int, alphabet ...[]rune) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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