sm.uuid
Associated object type: Uuid
A universally unique identifier (UUID) is a 128-bit number that can guarantee uniqueness across space and time.
To generate one, use sm.uuid.new.
Functions:
sm.uuid.generateNamed(namespace, name)
Generates a named (version 5) uuid.
Parameters:
Type | Name | Description |
---|---|---|
Uuid | namespace | A uuid namespace for the name. The namespace makes sure any equal name from different namespaces do not collide. |
string | name | A name, to generate a uuid from. Provided the same namespace and name, the uuid will be the same. |
Returns:
Type | Description |
---|---|
Uuid | The created uuid. |
sm.uuid.generateRandom()
Generates a random (version 4) uuid.
Returns:
Type | Description |
---|---|
Uuid | The generated uuid. |
sm.uuid.getNil()
Creates a nil uuid {00000000-0000-0000-0000-000000000000}
Returns:
Type | Description |
---|---|
Uuid | The nil uuid. |
sm.uuid.new(uuid=nil)
Creates a uuid from a string or generates a random uuid (version 4).
Parameters:
Type | Name | Description |
---|---|---|
string | uuid=nil | The uuid string to create a uuid instance from. If none is provided, generate a random uuid. |
Returns:
Type | Description |
---|---|
Uuid | The created uuid. |