{"id":19998903,"url":"https://github.com/hanaasagi/machine-uid","last_synced_at":"2025-10-26T15:16:06.548Z","repository":{"id":57635852,"uuid":"150985041","full_name":"Hanaasagi/machine-uid","owner":"Hanaasagi","description":"Get machine id without root permission","archived":false,"fork":false,"pushed_at":"2024-10-28T10:10:06.000Z","size":34,"stargazers_count":30,"open_issues_count":1,"forks_count":16,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-04T14:09:03.901Z","etag":null,"topics":["cross-platform","hostid","machine-id","uid"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/machine-uid","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Hanaasagi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-30T16:36:46.000Z","updated_at":"2025-02-17T05:53:35.000Z","dependencies_parsed_at":"2024-06-21T14:11:48.292Z","dependency_job_id":"6e9d1cb6-ad40-439a-b3e3-aeef95f8837c","html_url":"https://github.com/Hanaasagi/machine-uid","commit_stats":{"total_commits":35,"total_committers":5,"mean_commits":7.0,"dds":"0.17142857142857137","last_synced_commit":"d4a280d3076dcf2e43c4b15ac110bdb580c810e7"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hanaasagi%2Fmachine-uid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hanaasagi%2Fmachine-uid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hanaasagi%2Fmachine-uid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hanaasagi%2Fmachine-uid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hanaasagi","download_url":"https://codeload.github.com/Hanaasagi/machine-uid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248639407,"owners_count":21137840,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cross-platform","hostid","machine-id","uid"],"created_at":"2024-11-13T05:09:50.444Z","updated_at":"2025-10-26T15:16:06.484Z","avatar_url":"https://github.com/Hanaasagi.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# machine-uid\n\nGet os native machine id without root permission.\n\n[![machine-uid on GitHub Action][action-image]][action]\n[![machine-uid on crates.io][cratesio-image]][cratesio]\n[![total downloads][downloads-image]][cratesio]\n[![machine-uid on docs.rs][docsrs-image]][docsrs]\n\n[action-image]: https://github.com/Hanaasagi/machine-uid/actions/workflows/rust.yml/badge.svg\n[action]: https://github.com/Hanaasagi/machine-uid/actions/workflows/rust.yml\n[cratesio-image]: https://img.shields.io/crates/v/machine-uid.svg\n[downloads-image]: https://img.shields.io/crates/d/machine-uid\n[cratesio]: https://crates.io/crates/machine-uid\n[docsrs-image]: https://docs.rs/machine-uid/badge.svg\n[docsrs]: https://docs.rs/machine-uid\n\n### About machine id\n\nIn Linux, machine id is a single newline-terminated, hexadecimal, 32-character, lowercase ID. When decoded from hexadecimal, this corresponds to a 16-byte/128-bit value. This ID may not be all zeros. This ID uniquely identifies the host. It should be considered \"confidential\", and must not be exposed in untrusted environments. And do note that the machine id can be re-generated by root.\n\n**Please note that on \\*nix platforms, this library does not require any dependencies,\nbut on Windows, it requires the `winreg` dependency. So if you only need to build the \\*nix version,\nyou can use version 0.3.0.**\n\n### Usage\n\n```Rust\nuse machine_uid;\n\nfn main() {\n    let id: String = machine_uid::get().unwrap();\n    println!(\"{}\", id);\n}\n\n```\n\n### How it works\n\nIt get machine id from following source:\n\nLinux or who use systemd:\n\n```Bash\ncat /var/lib/dbus/machine-id # or /etc/machine-id\n```\n\nBSD:\n\n```Bash\ncat /etc/hostid # or kenv -q smbios.system.uuid\n```\n\nOSX:\n\n```Bash\nioreg -rd1 -c IOPlatformExpertDevice | grep IOPlatformUUID\n```\n\nWindows:\n\n```powershell\n(Get-ItemProperty -Path Registry::HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography).MachineGuid\n```\n\nillumos:\n\n```Bash\ngethostid(3C)\n```\n\n### Supported Platform\n\nI have tested in following platform:\n\n- Debian 8\n- OS X 10.6\n- FreeBSD 10.4\n- Fedora 28\n- Windows 10\n- OmniOS r151050\n\n### Changelog\n\n#### v0.5.3\n\n- Remove built in C dependency [#13](https://github.com/Hanaasagi/machine-uid/pull/13)\n\n#### v0.5.2\n\n- Add illumos support [#11](https://github.com/Hanaasagi/machine-uid/pull/11)\n- Upgrade winreg to 0.52 [#12](https://github.com/Hanaasagi/machine-uid/pull/12)\n- Upgrade bindgen to 0.69 [#12](https://github.com/Hanaasagi/machine-uid/pull/12)\n\n#### v0.5.1\n\n- Upgrade winreg to 0.50 [#9](https://github.com/Hanaasagi/machine-uid/pull/9)\n- Upgrade bindgen to 0.66 [#8](https://github.com/Hanaasagi/machine-uid/pull/8)\n\n#### v0.5.0\n\n- Fix cross-compilation issue [#7](https://github.com/Hanaasagi/machine-uid/pull/7)\n\n#### v0.4.0\n\n- Fix x86 program run on x64 [#4](https://github.com/Hanaasagi/machine-uid/pull/4)\n\n#### v0.3.0\n\n- Upgrade winreg to 0.11\n\n#### v0.2.0\n\n- Added support for Windows\n\n### License\n\n[MIT License](https://github.com/Hanaasagi/machine-id/blob/master/LICENSE) Copyright (c) 2018, Hanaasagi\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhanaasagi%2Fmachine-uid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhanaasagi%2Fmachine-uid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhanaasagi%2Fmachine-uid/lists"}