device-fingerprint 0.1.1

Collect hardware information to generate a unique device fingerprint; Windows systems only.
Documentation
# device-fingerprint


[![Crates.io](https://img.shields.io/crates/v/device-fingerprint.svg)](https://crates.io/crates/device-fingerprint)
[![Documentation](https://docs.rs/device-fingerprint/badge.svg)](https://docs.rs/device-fingerprint)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Generate a unique device fingerprint by collecting hardware identifiers from Windows devices.

## Features


- **No Admin Rights Required** - All collection methods work without elevated privileges
- **Pure Windows API** - Uses only `windows-sys` for native API calls, with optional WMIC support
- **Stable & Reliable** - Generates fingerprints based on Machine GUID and CPU characteristics
- **SHA256 Output** - Produces a standard 64-character hash value

## Installation


Add the dependency to your `Cargo.toml`:

```toml
[dependencies]
device-fingerprint = "0.1.1"
```

## Quick Start


```rust
use device_fingerprint::{generate, verify};

fn main() {
    // Generate device fingerprint
    let fingerprint = generate();
    println!("Device Fingerprint: {}", fingerprint);

    // Verify device fingerprint
    if verify(&fingerprint) {
        println!("Fingerprint verification passed");
    }
}
```

## API Documentation


### Main Functions


| Function | Description |
|----------|-------------|
| `generate()` | Generate device fingerprint, returns 64-character SHA256 hash |
| `verify(expected)` | Verify if the fingerprint matches the current device |

### Collector Module


| Function | Description |
|----------|-------------|
| `collectors::machine_guid()` | Get Windows Machine GUID |
| `collectors::cpu_id()` | Get CPU vendor and feature information |
| `collectors::wmic_uuid()` | (Optional) Get SMBIOS UUID via WMI |

## Collected Information


| Component | Source | Stability |
|-----------|--------|-----------|
| Machine GUID | Registry `HKLM\SOFTWARE\Microsoft\Cryptography` | Changes after OS reinstall |
| CPU ID | CPUID instruction | Changes after CPU replacement |

## Use Cases


Use this library in scenarios where client-side feature modification is restricted, enabling:
- Software license binding
- Device authentication

## System Requirements


- Windows 7 and above
- x86 / x86_64 architecture

## License


MIT