2 unstable releases
Uses new Rust 2024
| 0.2.0 | Dec 10, 2025 |
|---|---|
| 0.1.0 | Dec 10, 2025 |
#86 in Accessibility
11KB
234 lines
rs-machineid
Generate a unique machine ID for any host (without admin privileges).
Features
- Cross-Platform (tested on Win7+, Debian 8+, Ubuntu 14.04+, OS X 10.6+, FreeBSD 11+)
- No admin privileges required
- Hardware independent (no usage of MAC, BIOS or CPU — those are too unreliable, especially in a VM environment)
- Compatible with Docker containers
Install
Add rs-machineid to your Cargo.toml:
[dependencies]
rs-machineid = "0.2.0" # replace with latest version
Usage
To obtain the raw GUID of the device, use MachineId::get() or MachineId::get_hashed():
use rs_machineid::{MachineID};
println!("Machine ID: {}", MachineId::get());
println!("Machine ID Hash: {}", MachineId::get_hashed("test_app"));
Thanks
Special thanks to Denis Brodbeck for his Go package, machineid.
Dependencies
~0.8–12MB
~81K SLoC