Skip to main content

uuid

Lua library that allows generating universally-unique identifiers (UUIDs)

Status​

External: Functionality is provided by a third-party library, which may or may not give semantic versioning guarantees

Availability​

This module is preloaded. You can simply require it:

local uuid = require("uuid")

Fields​

RFC_STRING_PATTERN​

A Lua string pattern that can be used to match strings according to the standardized RFC UUID format.

Functions​

createBasicUUID​

Generates a UUID using the default (basic) random number generator. May produce inferior randomness (see details here).

Available since: v0.0.1

createMersenneTwistedUUID​

Generates a UUID using the mt19937 random number generator. Produces high-quality randomness via Mersenne Twister Engine.

Available since: v0.0.1

createNameBasedUUID​

Generates a name-based UUID using SHA-1 hashing to deterministically produce an identifier based on a given namespace-name-pair.

Available since: v0.0.1
Arguments
#NameTypeFallback
namespacestring
namestring
Return values
#NameType
uuidstring

createSystemUUID​

Generates a UUID using a nonstandard, platform-specific random number generator. It currently uses the following APIs internally:

Available since: v0.0.1

isCanonical​

Returns whether or not the given value is a valid RFC UUID string, i.e., whether it matches the RFC_STRING_PATTERN.

Available since: v0.0.1
Arguments
#NameTypeFallback
inputany
Return values
#NameType
isValidUUIDboolean

Changelog​

VersionWhat happened?
v0.0.1Initial release