ids

package
v0.1.16 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultLength = 6
View Source
const EntityLength = 4

EntityLength is a shorter length for low-volume entity IDs (sessions, rules, notes).

Variables

This section is empty.

Functions

func Derive added in v0.1.16

func Derive(length int, parts ...string) string

Derive returns a deterministic base62 ID of the given length from the joined parts.

func Generate

func Generate(length int) string

Generate returns a cryptographically random base62 ID of the specified length.

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