nanoid

package module
v0.0.0-...-8cb6a52 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

View Source
const (
	CHARACTERS_NUMBERS    = "0123456789"
	CHARACTERS_LOWERCASE  = "abcdefghijklmnopqrstuvwxyz"
	CHARACTERS_UPPERCASE  = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
	CHARACTERS_SYMBOLS    = "_-"
	CHARACTERS_LOOK_ALIKE = "1lI0Oouv5Ss"

	SAFE_LENGTH = 21
)

Variables

This section is empty.

Functions

func New

func New(opts Opts) string

New returns a random string with the given options.

func NewSafe

func NewSafe() string

NewSafe quickly returns a random string with the safe options.

Types

type Opts

type Opts struct {
	Numbers   bool
	Lowercase bool
	Uppercase bool
	/*
		Symbols are "_-"
	*/
	Symbols bool
	/*
		LookAlike are "1lI0Oouv5Ss"
	*/
	ExcludeAlike bool
	Length       int
}

Jump to

Keyboard shortcuts

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