Logo

DIVERSITY

Documentation

Library

IDs

Utility functions for generating and managing unique identifiers.

Shared Functions


CreateUniqueId

Generates a unique identifier string, optionally avoiding collisions with existing IDs and allowing custom length or pattern.

client.lua
local id = dLib.Ids.CreateUniqueId()
ArgumentTypeDescription
tbl?
table | nil
Ids to check against. Must be the key to the tables value.
len?
number | nil
Desired length of the generated ID; defaults to 8 if omitted.
pattern?
string | nil
Custom pattern or character set to use when generating the ID. Defaults to alphanumeric.
Returned DataTypeDescription
id
string
The generated unique identifier string.

Was this page helpful?