Create a unique MachineID/HWID/UUID with customizable options, like .Net DeviceId
Last updated May 30, 2026
88
Stars
37
Forks
15
Issues
0
Stars/day
Attention Score
21
Topics
Language breakdown
Rust 100.0%
โธ Files
click to expand
README
MachineID for Rust - Like .Net DeviceId
This Rust package is inspired by DeviceId, a .Net package to build a unique Machine ID.
Features
- 3 Different types of hash (MD5, SHA1, SHA256)
- Different components to make the ID
- Support for Windows, Linux and MacOS
- No Admin privileges are required
How to use
First add this to your Cargo.toml file
[dependencies]
machineid-rs = "1.2.4"
Then, you need to define the builder variable with the encryption type you want.
For example, SHA256
use machineid_rs::{IdBuilder, Encryption};
// There are 3 different encryption types: MD5, SHA1 and SHA256. let mut builder = IdBuilder::new(Encryption::SHA256);
After that, you just need to add the components you want the id to have.
The available components are:
- System UUID: Unique identifier of your machine
- CPU Cores: Number of physical cores from your computer
- OS Name: Operative System name, i.e., linux/windows
- Username: The username currently being used
- Machine Name: The name of the machine
- CPU ID: The serial number of the processor
- Drive Serial : The serial number of the disk storing the OS.
use machineid_rs::HWIDComponent;
builder.addcomponent(HWIDComponent::SystemID).addcomponent(HWIDComponent::CPUCores);
Once you are ready, you just need to build the id with your key
let hwid = builder.build("mykey").unwrap();
Todo
- Optimize the code
- Fix bugs and increase platform integration/stability
๐ More in this category