LocalId class

A compact, document-scoped identifier for a node, resource, skin, animation, or payload.

A local id is a (session, index) pair: session is the 32-bit random salt of the IdAllocator that minted it, and index is that allocator's monotonic counter. The salt makes ids minted on different machines or branches collision-free without a coordinator (a merge is a set union, no renumbering); the counter is never reused. Both halves are 32-bit, so the pair is web-safe and a fast map key.

Constructors

LocalId(int session, int index)
Wraps an explicit session salt and index counter. Prefer IdAllocator.mint to allocate fresh ids.
const
LocalId.parse(String token)
Parses a local id from its token (the inverse of toToken), ignoring any leading readability prefix (n:, geo:, ...). Throws a FormatException if it does not decode to 8 bytes.
factory

Properties

hashCode int
The hash code for this object.
no setteroverride
index int
The monotonic counter within that session.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
session int
The 32-bit session salt of the minting allocator.
final

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 token: Crockford base32 of the 8 id bytes (the big-endian session followed by the big-endian index).

Operators

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