ids

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultLength = 6

Variables

This section is empty.

Functions

func Generate

func Generate(length int) string

Generate returns a cryptographically random base62 ID of the specified length. If length is 0, uses DefaultLength (6).

func IsValid

func IsValid(id string) bool

IsValid returns true if the ID contains only valid base62 characters. Used to validate user-supplied IDs to prevent path traversal.

Types

This section is empty.

Jump to

Keyboard shortcuts

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