DocumentId class

A 128-bit document identifier, minted once when a document is created.

Stored as 16 bytes; the text form is Crockford base32. The high bits are stamped UUIDv4 (random) so the id is a well-formed UUID, but the bytes are the identity, not the UUID fields.

Constructors

DocumentId(Uint8List bytes)
Wraps the given 16 bytes.
DocumentId.generate([Random? random])
Mints a new random document id (UUIDv4 layout). Pass a seeded random for deterministic tests; the default is cryptographically random.
factory
DocumentId.parse(String token)
Parses a document id from its base32 token (the inverse of toToken). Throws a FormatException if it does not decode to 16 bytes.
factory

Properties

bytes Uint8List
The 16 identity bytes.
final
hashCode int
The hash code for this object.
no setteroverride
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.
override
toToken() String
The canonical text form: 26-character Crockford base32.

Operators

operator ==(Object other) bool
The equality operator.
override