uuid

Typefunction
DictionaryLCS
LibraryLiveCode Script
Syntax
uuid ([<uuidType>, [<namespace>, <uuidName>]])
Summary

Genrates a universally unique identifier (UUID)

Introduced6.1
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Parameters
NameTypeDescription
uuidType

A string. The type of UUID to be generated, one of: - empty - "random" - "md5" - "sha1"

uuidName

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

Example
get uuid()
put uuid("random") into tRandomUUID
Values
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.

RelatedFunction: md5Digest
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.