MachineId class

Reads a stable, per-machine identifier provided by the operating system.

This value survives reboots and process restarts (unlike a hostname rename it is keyed to the install/hardware), making it a good stable input for a deterministic node/hub UID:

  • Linux/etc/machine-id (falling back to /var/lib/dbus/machine-id).
  • macOS — the IOPlatformUUID reported by ioreg.
  • WindowsMachineGuid under HKLM\SOFTWARE\Microsoft\Cryptography.

Returns an empty string when no identifier can be obtained, so UID computation degrades gracefully rather than failing. The result is always trimmed and lower-cased for stability across platforms.

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

read() String
Resolves the machine id for the current platform, or '' if unavailable.