id

package
v0.84.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(idLen uint8, optionalCharset ...string) (string, error)

New generates a cryptographically random string ID of the specified length. By default, IDs consist of mixed-case alphanumeric characters (0-9, A-Z, a-z). A single optional custom charset can be provided if you want to use different characters. The idLen parameter must be between 0 and 255 inclusive. If provided, the custom charset length must be between 1 and 255 inclusive.

func NewMulti

func NewMulti(idLen uint8, quantity uint8, optionalCharset ...string) ([]string, error)

NewMulti generates multiple cryptographically random string IDs of the specified length and quantity. By default, IDs consist of mixed-case alphanumeric characters (0-9, A-Z, a-z). A single optional custom charset can be provided if you want to use different characters. The idLen parameter must be between 0 and 255 inclusive.

Types

This section is empty.

Jump to

Keyboard shortcuts

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