Discover Packages
github.com/nlgolib/nanoid
package
module
Version:
v1.1.0
Opens a new window with list of versions in this module.
Published: Mar 12, 2025
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
nanoid
nanoid is a Go implementation of the nanoid library.
Installation
go get github.com/nlgolib/nanoid
Functionality Highlights
Generate Nanoid with custom alphabet and size
Generate Nanoid without alike characters (1lI0Oouv5Ss)
Generate safe Nanoid (length 21), which is proofed to be collision free
Expand ▾
Collapse ▴
Documentation
¶
View Source
const (
ALPHABET_NUMBERS = "0123456789"
ALPHABET_LOWERCASE = "abcdefghijklmnopqrstuvwxyz"
ALPHABET_UPPERCASE = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
)
New generates a new nanoid with the given size and alphabet.
NewSafe generates a new nanoid with all alphabet characters without alike characters.
The length is 21, which is proofed to be safe from collisions.
NewWithoutAlike generates a new nanoid without alike characters (1lI0Oouv5Ss).
It removes the alike characters from the alphabet and generates a new nanoid.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.