UUID class

Constructors

UUID()

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

fromBuffer(List<int> buffer) → String
Converts a raw 16-byte buffer to its UUID string form.
isValid(String uuid) → bool
True if uuid is validly formatted as any of the versions this class generates (v1, v3, v4, v5, v7).
toBuffer(String uuidString, {bool validate = true}) → BuBytes
Converts a UUID string to its raw 16-byte buffer.
v1() → String
Generates a version 1 (time-based) UUID: a 60-bit timestamp (100ns intervals since 1582-10-15) plus a random clock sequence and node ID.
v3(String namespace, String name) → String
Generates a version 3 (name-based, MD5) UUID: deterministic for a given (namespace, name) pair - the same inputs always produce the same UUID. namespace is itself a UUID string; use one of namespaceDns/namespaceUrl/namespaceOid/namespaceX500, or any UUID string of your own for a custom namespace.
v4() → String
Generates a version 4 (random) UUID.
v5(String namespace, String name) → String
Generates a version 5 (name-based, SHA-1) UUID - the same idea as v3 but with SHA-1, which RFC 4122/9562 recommends over v3 for new uses.
v7() → String
Generates a version 7 UUID: a 48-bit Unix timestamp in milliseconds followed by random bits. Unlike v1/v4, v7 UUIDs generated in increasing time order sort in increasing lexicographic/byte order too - useful as a database primary key where index locality matters.

Constants

namespaceDns → const String
namespaceOid → const String
namespaceUrl → const String
namespaceX500 → const String