/ULID

πŸ”– Lua ULID generator (Universally unique Lexicographically sortable IDentifier)

Primary LanguageLuaGNU General Public License v3.0GPL-3.0

ULID

ULID

This is a very simple Lua ULID (Universally unique Lexicographically sortable IDentifier) generator

Note: This was made for nanos worldβ„’, if you plan to use it outside you'll have to make some tweaks to the library


ULID.Clear

πŸ”Έ Client
πŸ”Ή Server
Removes the ULID from the cache

@param sULID β€” The ULID to remove

function ULID.Clear(sULID: string)

ULID.Generate

πŸ”Έ Client
πŸ”Ή Server
Generate a random ULID

@param xData β€” The data to bind to the ULID, defaults to true

@return β€” The generated ULID

function ULID.Generate(xData?: any)
  -> string

ULID.Get

πŸ”Έ Client
πŸ”Ή Server
Return a value binded to the passed ULID

@param sULID β€” The ULID to search

@return β€” The value binded to the ULID, defaults to true

function ULID.Get(sULID: string)
  -> any

ULID.GetTable

πŸ”Έ Client
πŸ”Ή Server
Returns the ULID registry

@return β€” The ULID registry

function ULID.GetTable()
  -> table<string, any>

ULID.Store

πŸ”Έ Client
πŸ”Ή Server
Adds an ULID to the cache

@param sULID β€” The ULID to add

@param xData β€” The data to bind to the ULID, defaults to true

function ULID.Store(sULID: string, xData?: any)