uuid
Lua library that allows generating universally-unique identifiers (UUIDs)
Status
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:
- Windows: CoCreateGuid
- Linux: uuid_generate
- Mac OS: CFUUIDCreate
isCanonical
Returns whether or not the given value is a valid RFC UUID string, i.e., whether it matches the RFC_STRING_PATTERN.
Changelog
Version | What happened? |
---|---|
v0.0.1 | Initial release |