#uuid #machine

bin+lib machine_uuid

A library to retrieve a machines UUID

1 unstable release

0.1.0 Feb 27, 2020

#30 in #machine

Download history 14/week @ 2023-02-02 6/week @ 2023-02-09 22/week @ 2023-02-16 27/week @ 2023-02-23 23/week @ 2023-03-02 10/week @ 2023-03-09 12/week @ 2023-03-16 17/week @ 2023-03-23 11/week @ 2023-03-30 12/week @ 2023-04-06 7/week @ 2023-04-13 3/week @ 2023-04-20 16/week @ 2023-04-27 14/week @ 2023-05-04 24/week @ 2023-05-11 16/week @ 2023-05-18

70 downloads per month
Used in 2 crates

MIT/Apache

6KB
79 lines

Machine UUID

A library that retrieves UUID for a machine

OS Support

  1. Windows - depends on WMIC
  2. Linux - depends on /etc/machine-id

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);

Add this to your Cargo.toml:

[dependencies]
machine_uuid = "0.1.0"

Dependencies

~1–1.4MB
~38K SLoC