RandomIdGenerator class
The default IdGenerator: a per-process monotonic counter combined with random entropy, so ids are unique within a process and unpredictable across processes without requiring an external dependency.
- Implemented types
Constructors
- RandomIdGenerator([Random? random])
-
Creates a random id generator. Pass a seeded
randomfor reproducible output in tests; defaults to Random.secure.
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
-
next(
[String prefix = '']) → String -
Returns a fresh identifier, optionally namespaced with
prefix(e.g.conn,node,req).override -
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