Uuid class Null safety

Represents a RFC 4122 UUID. More generally, any 128-bit byte sequence can be represented by this class, but the semantics for the fields described in the may not apply for other variants.

Instances follow the rules for equivalence and ordering laid out by the RFC.

Implemented types
Annotations

Constructors

Uuid.fromBytes(ByteBuffer uuidBytes)
Construct a UUID from the given byte buffer.
factory
Uuid.fromString(String uuidString)
Parses a UUID from the given String.
factory
Uuid.v1({int? nodeId})
Generates a v1 (time-based) UUID.
factory
Uuid.v4({Random? random})
Generates a v4 (random) UUID.
factory
Uuid.v5({required Uuid namespace, required String name})
Generates a v5 (name-based with SHA-1) UUID.
factory

Properties

bytes ByteBuffer
The raw bytes of this UUID. The returned ByteBuffer is unmodifiable and contains exactly 16 bytes.
final
clockSequence int
The combined clock sequence. Note that the semantics of this value differ between UUID versions. For v4 UUIDs in particular, this is a random value.
read-only
clockSequenceHigh int
The high field of the clock sequence without the variant.
read-only
clockSequenceHighAndReserved int
The high field of the clock sequence multiplexed with the variant.
read-only
clockSequenceLow int
The low field of the clock sequence.
read-only
hashCode int
The hash code for this object.
read-only, override
node int
The spatially unique node identifier.
read-only
parsedTime DateTime
The parsed time as a usable DateTime object.
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
time int
The full "timestamp" of the UUID. Note that parsedTime provides a parsed version of this timestamp, albeit only for v1 UUIDs.
read-only
timeHigh int
The high field of the timestamp without the version number that was originally multiplexed into timeHighAndVersion.
read-only
timeHighAndVersion int
The high field of the timestamp multiplexed with the version number, i.e. octets 6-7. For v4 UUIDs, the timestamp will be random, but the version bits will be 4 (0b0100).
read-only
timeLow int
The low field of the timestamp, i.e. octets 0-3. This field will be random for v4 UUIDs.
read-only
timeMid int
The mid field of the timestamp, i.e. octets 4-5. This field will be random for v4 UUIDs.
read-only
variant UuidVariant
The UUID variant which determines the layout of the UUID.
read-only
version int
The version that was originally multiplexed in timeHighAndVersion.
read-only

Methods

compareTo(Uuid other) int
Compares this object to another object.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() String
Returns the string representation of this UUID as specified by RFC 4122.
override

Operators

operator <(Uuid other) bool
operator <=(Uuid other) bool
operator ==(Object other) bool
The equality operator.
override
operator >(Uuid other) bool
operator >=(Uuid other) bool

Static Properties

nil Uuid
The nil UUID is special form of UUID that is specified to have all 128 bits set to zero.
final