"""Machine fingerprint helper using stdlib-only methods."""

from __future__ import annotations

import hashlib
import platform
import uuid


def get_machine_id() -> str:
    """Get a unique machine identifier.

    Generates a SHA-256 hash from the MAC address (via ``uuid.getnode()``)
    and hostname (via ``platform.node()``). No external dependencies required.

    Returns:
        A hex-encoded SHA-256 hash string.
    """
    mac = str(uuid.getnode())
    hostname = platform.node()
    raw = f"{mac}{hostname}"
    return hashlib.sha256(raw.encode("utf-8")).hexdigest()
