// engine/license-validator/fingerprint.ts — Deterministic machine identity for license binding.
// Uses only node:os and node:crypto — no external deps.
import { createHash } from 'node:crypto';
import { arch, hostname, platform, userInfo } from 'node:os';
export function computeMachineFingerprint() {
    const raw = [hostname(), platform(), arch(), userInfo().username].join('|');
    return createHash('sha256').update(raw).digest('hex');
}
export function verifyMachineFingerprint(stored) {
    if (!stored) {
        // Legacy state (pre-hardening) — no fingerprint stored yet.
        // Allow access; fingerprint will be added on next revalidation.
        return true;
    }
    return computeMachineFingerprint() === stored;
}
//# sourceMappingURL=fingerprint.js.map