UUUID class abstract

Makes UUIDs (RFC 9562) with no package; v4 random and v7 time-sorted are the usual picks. UUUID.uuidV4()

Constructors

UUUID()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

isValid(String value) → bool
True when value looks like a UUID ("8-4-4-4-12" hex). UUUID.isValid(id)
timeOf(String value) → DateTime?
Creation time stored in a v7 UUID. UUUID.timeOf(id)
uuidV1() → String
Time + random node id (v1); sortable only within one device. UUUID.uuidV1()
uuidV4() → String
Fully random (v4), the classic choice for ids. UUUID.uuidV4() → "3f0c…-4…"
uuidV5(String namespace, String name) → String
Same name + namespace always gives the same id (v5, SHA-1). UUUID.uuidV5(UUUID.namespaceUrl, "https://x.com")
uuidV6() → String
Like v1 but the time comes first so ids sort by creation (v6). UUUID.uuidV6()
uuidV7() → String
Millisecond time + random, sorts by creation; best for database keys (v7). UUUID.uuidV7()
uuidV8([List<int>? bytes]) → String
Custom layout (v8): your 16 bytes with only version/variant bits set; random when omitted. UUUID.uuidV8()
versionOf(String value) → int?
Version number of a UUID (1-8), or null if it is not one. UUUID.versionOf(UUUID.uuidV7()) → 7

Constants

namespaceDns → const String
Namespace for uuidV5 names that are domain names.
namespaceUrl → const String
Namespace for uuidV5 names that are URLs.