nanoid

package
v0.1.23 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultLength = 21

DefaultLength is the default length for NanoID.

Variables

View Source
var ErrInvalidLength = errors.New("nanoid: length for ID is invalid (must be within 2-255)")

Functions

func New

func New(length int) (generator, error)

New returns a new NanoID generator with the standard alphabet and length.

func Unicode

func Unicode(alphabet string, length int) (generator, error)

Unicode returns a Nano ID generator which uses a custom Unicode alphabet.

Types

This section is empty.

Jump to

Keyboard shortcuts

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