MCPcopy Index your code
hub / github.com/Taptiive/machineid-rs

github.com/Taptiive/machineid-rs @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
34 symbols 65 edges 6 files 6 documented · 18%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Check, build and deploy! docs.rs docs

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.

For example, i will add the System UUID and CPU Cores

use machineid_rs::HWIDComponent;

builder.add_component(HWIDComponent::SystemID).add_component(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

Feel free to report any bug you find! ;)

Core symbols most depended-on inside this repo

add_component
called by 35
src/lib.rs
to_string
called by 11
src/lib.rs
build
called by 3
src/lib.rs
run_command
called by 2
src/linux.rs
get_mac_addressof_interface
called by 2
src/linux.rs
get_file_content
called by 2
src/linux.rs
file_token
called by 1
src/utils.rs
generate_hash
called by 1
src/lib.rs

Shape

Function 16
Method 10
Class 6
Enum 2

Languages

Rust100%

Modules by API surface

src/lib.rs12 symbols
src/linux.rs9 symbols
src/windows.rs5 symbols
src/errors.rs4 symbols
src/macos.rs3 symbols
src/utils.rs1 symbols

For agents

$ claude mcp add machineid-rs \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact