Skip to main content

uuid

Type​

function

Summary​

Genrates a universally unique identifier (UUID)

Syntax​

uuid ([<uuidType>, [<namespace>, <uuidName>]])

Description​

Use the uuid function to genrate a universally unique identifier.

The uuid returns a UUID, the type of UUID can be specified.

If uuidType is "md5" or "sha1" then it returns a version 3 (md5) or version 5 (sha1) UUID. Here namespace should be the UUID of the namespace in which name sits, and uuidName can be any string.

Warning: If you are using UUIDs as a security credential or any part of an authentication scheme, you are recommended to use only the "random" uuidType.

Parameters​

NameTypeDescription

uuidType

enum

A string. The type of UUID to be generated, one of:

  • empty
  • "random"
  • "md5"
  • "sha1"

uuidName

string

Any string, where type is "md5" or "sha1"

namespace

Where type is "md5" or "sha1", the UUID of the namespace in which the uuidName sits

Examples​

get uuid()
put uuid("random") into tRandomUUID

Value​

NameTypeDescription

return

If the uuidType is empty or "random" a version 4 (random) UUID is returned. A cryptographic quality pseudo-random number generator is used to generate the randomness.

If the uuidType is "md5" a version 3 UUID is returned.

If the uuidType is "sha1" a version 5 UUID is returned.

function: md5Digest

Compatibility and Support​

Introduced

LiveCode 6.1

OS

mac

windows

linux

ios

android

Platforms

desktop

server

mobile

Thank you for your feedback!

Was this page helpful?