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).

createMersenneTwistedUUID

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

createNameBasedUUID

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

createSystemUUID

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

isCanonical

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

Changelog

VersionWhat happened?
v0.0.1Initial release