Exid.Platform (exid v0.1.0)

View Source

Platform-specific machine ID detection.

Attempts to read the platform-specific machine ID based on the OS:

  • Darwin (macOS): Uses ioreg command for IOPlatformUUID
  • FreeBSD: Uses sysctl kern.hostuuid
  • Linux: Uses system-dependent methods
  • Others: Falls back to hostname hash

Summary

Functions

Reads the platform-specific machine ID.

Functions

read_platform_machine_id()

@spec read_platform_machine_id() :: {:ok, String.t()} | {:error, term()}

Reads the platform-specific machine ID.

Returns the ID as a string, or {:error, reason} if unavailable.

Supported platforms:

  • Darwin (macOS): IOPlatformUUID via ioreg command
  • FreeBSD: kern.hostuuid via sysctl
  • OpenBSD: hw.uuid via sysctl
  • Linux: /etc/machine-id or /sys/class/dmi/id/product_uuid
  • Windows: MachineGuid from Windows Registry