// Copyright (c) 2025-2026 Rocky Software Inc.
// All rights reserved.
//
// This file is part of the RockyGuard library and is distributed under
// the terms of the RockyGuard Library Software License Agreement. See
// docs/RockyGuard_License_Agreement.pdf in the distribution.
//
// No part of this file may be copied, modified, or distributed except
// as expressly permitted by the license agreement.

#pragma once

#include "export.h"
#include <string>

namespace rockyguard {

struct ROCKYGUARD_API HardwareComponents {
    std::string mac_address;
    std::string cpu_id;
    std::string disk_serial;
    std::string motherboard_id;
};

class ROCKYGUARD_API HardwareFingerprint {
public:
    // Collect all available hardware components from this machine
    static HardwareComponents collect();

    // Produce a combined fingerprint string: "hash1|hash2|hash3|hash4"
    // Each component is individually SHA-256 hashed
    static std::string compute_fingerprint(const HardwareComponents& hw);

    // Convenience: collect + compute
    static std::string fingerprint();

    // Compare two fingerprint strings, return count of matching components
    static int match_count(const std::string& fp_a, const std::string& fp_b);
};

} // namespace rockyguard
