1 unstable release
0.2.0 | May 16, 2024 |
---|
#538 in Procedural macros
9KB
114 lines
Machine UUID
A library that retrieves UUID for a machine
This is a fork. Migrated away for continued versioned fixes
OS Support
- Windows - depends on WMIC
- Linux - depends on /etc/machine-id
- macOS - depends on ioreg
Usage
let uuid = machineid::get();
// Based on OS, UUID format will differ
// Windows
assert_eq!("140EF834-2DB3-0F7A-27B4-4CEDFB73167C", uuid);
// Based on OS, UUID format will differ
// Linux
assert_eq!("92cc698195f84d3b85f1cfb0a09e957f", uuid);
// Based on OS, UUID format will differ
// macOS
assert_eq!("F7FA2B78-F7D4-5B1B-A4E3-BACB1BBD95A1", uuid)
TODO
- Adhere to API Guidelines
- Improve error reporting.
- Improve test for Linux UUID to use -
Add this to your Cargo.toml:
[dependencies]
machine_uuid = "0.2.0"
Dependencies
~2.2–3MB
~55K SLoC