Uniqueid
The Uniqueid registry offers functions to generate unique identifiers, such as UUIDs, which are essential for creating distinct and traceable entities in your applications.
uuidv4
Uuidv4 generates a new random UUID (Universally Unique Identifier) version 4.
Signature
{{ uuidv4 }} // Output(will be different): 3f0c463e-53f5-4f05-a2ec-3c083aa8f937uuidv7
Uuidv7 generates a new UUID version 7, based on the current Unix time in milliseconds. Unlike a version 4, successive UUIDs are sortable by generation time.
Signature
{{ uuidv7 }} // Output(will be different): 018f5395-4e88-7c2a-9f3b-1d7e4a6c8b90uuidv5
Uuidv5 generates a UUID version 5, derived from a namespace and a name using SHA-1. The same namespace and name always produce the same UUID.
Signature
{{ "python.org" | uuidv5 "dns" }} // Output: 886313e1-3b8a-5372-9b90-0c9aee199e5d
{{ "python.org" | uuidv5 "6ba7b810-9dad-11d1-80b4-00c04fd430c8" }} // Output: 886313e1-3b8a-5372-9b90-0c9aee199e5d
{{ "python.org" | uuidv5 "invalid" }} // Erroruuidv3
Uuidv3 generates a UUID version 3, derived from a namespace and a name using MD5. The same namespace and name always produce the same UUID.
Signature
Prefer uuidv5 for new usages, the version 3 only exists for compatibility with systems already relying on MD5 derived UUIDs.
uuidNil
UuidNil returns the nil UUID, the UUID with all its bits set to zero.
Signature
isUUID
IsUUID checks if the given value is a valid UUID.
Signature
uuidVersion
UuidVersion returns the version of the given UUID.
Signature
uuidTime
UuidTime returns the time embedded in the given UUID. Only the versions carrying a timestamp are supported, namely the versions 1, 2, 6 and 7.
Signature
Last updated