IdGenerator class

Generates trace and span IDs according to the W3C Trace Context specification.

Constructors

IdGenerator()

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

bytesToHex(List<int> bytes) → String
Convert bytes to lowercase hex string.
generateSpanId() → Uint8List
Generate an 8-byte span ID. Returns bytes which can be formatted as a 16-char hex string.
generateTraceId() → Uint8List
Generate a 16-byte trace ID. Returns bytes which can be formatted as a 32-char hex string.
hexToBytes(String hex) → Uint8List?
Parse a lowercase hex string to bytes. Returns null for an odd length or any non-lowercase-hex character.