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:

  • generateNamed
  • generateRandom
  • getNil
  • new

  • sm.uuid.generateNamed(namespace, name)

    Generates a named (version 5) uuid.

    Parameters:

    TypeNameDescription
    UuidnamespaceA uuid namespace for the name. The namespace makes sure any equal name from different namespaces do not collide.
    stringnameA name, to generate a uuid from. Provided the same namespace and name, the uuid will be the same.

    Returns:

    TypeDescription
    UuidThe created uuid.

    sm.uuid.generateRandom()

    Generates a random (version 4) uuid.

    Returns:

    TypeDescription
    UuidThe generated uuid.

    sm.uuid.getNil()

    Creates a nil uuid {00000000-0000-0000-0000-000000000000}

    Returns:

    TypeDescription
    UuidThe nil uuid.

    sm.uuid.new(uuid=nil)

    Creates a uuid from a string or generates a random uuid (version 4).

    Parameters:

    TypeNameDescription
    stringuuid=nilThe uuid string to create a uuid instance from. If none is provided, generate a random uuid.

    Returns:

    TypeDescription
    UuidThe created uuid.