Documentation
¶
Overview ¶
Copyright 2022 jaevor. License can be found in the LICENSE file.
Original reference: https://github.com/ai/nanoid
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidLength = errors.New("length for ID is invalid (must be within 2-255)")
Functions ¶
func ASCII ¶
Returns a NanoID generator that uses an alphabet of ASCII characters 40-126 inclusive.
🟡 Errors if length is not, or within 2-255.
🧿 Concurrency safe.
func Custom ¶
Will be deprecated; same as nanoid.CustomUnicode.
🟡 Change to using nanoid.CustomUnicode.
func CustomASCII ¶
Returns a Nano ID generator which uses a custom ASCII alphabet.
Uses less memory than CustomUnicode by only supporting ASCII. For unicode support use nanoid.CustomUnicode.
🟡 Errors if alphabet is not valid ASCII or if length is not, or within 2-255.
🧿 Concurrency safe.
func CustomUnicode ¶
Returns a Nano ID generator which uses a custom alphabet that is allowed to contain non-ASCII (unicode).
Uses more memory by supporting unicode. For ASCII-only, use nanoid.CustomASCII.
🟡 Errors if length is not, or within 2-255.
🧿 Concurrency safe.
Types ¶
This section is empty.