{"id":19900271,"url":"https://github.com/sandipmavani/hardwareid","last_synced_at":"2025-05-02T23:30:44.875Z","repository":{"id":57575005,"uuid":"209730757","full_name":"sandipmavani/hardwareid","owner":"sandipmavani","description":"Get the hardware address and generate id on it","archived":false,"fork":false,"pushed_at":"2023-08-09T02:22:53.000Z","size":37,"stargazers_count":8,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-07T08:17:18.850Z","etag":null,"topics":["go","golang","hardwareid","library","mac-address","machine-id","machine-identity"],"latest_commit_sha":null,"homepage":"","language":"Go","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/sandipmavani.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2019-09-20T07:23:08.000Z","updated_at":"2025-02-17T02:48:24.000Z","dependencies_parsed_at":"2024-06-20T08:23:08.918Z","dependency_job_id":null,"html_url":"https://github.com/sandipmavani/hardwareid","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandipmavani%2Fhardwareid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandipmavani%2Fhardwareid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandipmavani%2Fhardwareid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandipmavani%2Fhardwareid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sandipmavani","download_url":"https://codeload.github.com/sandipmavani/hardwareid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252122147,"owners_count":21698304,"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":["go","golang","hardwareid","library","mac-address","machine-id","machine-identity"],"created_at":"2024-11-12T20:11:48.845Z","updated_at":"2025-05-02T23:30:44.600Z","avatar_url":"https://github.com/sandipmavani.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hardwareid provides support for reading the unique hardware address of most host OS's \n![Image of Gopher 47](logo.png)\n\n… because sometimes you just need to reliably identify your hardwares.\n\n[![GoDoc](https://godoc.org/github.com/sandipmavani/hardwareid?status.svg)](https://godoc.org/github.com/sandipmavani/hardwareid) [![Go Report Card](https://goreportcard.com/badge/github.com/sandipmavani/hardwareid)](https://goreportcard.com/report/github.com/sandipmavani/hardwareid)\n\n## Main Features\n\n* Cross-Platform (tested on Win7+, Debian 8+, Ubuntu 14.04+, OS X 10.6+, FreeBSD 11+)\n* No admin privileges required\n* Hardware independent (no usage of MAC, BIOS or CPU — those are too unreliable, especially in a VM environment)\n* IDs are unique\u003csup\u003e[1](#unique-key-reliability)\u003c/sup\u003e to the installed OS\n\n## Installation\n\nGet the library with\n\n```bash\ngo get github.com/sandipmavani/hardwareid\n```\n\nYou can also add the cli app directly to your `$GOPATH/bin` with\n\n```bash\ngo get github.com/sandipmavani/hardwareid/cmd/hardwareid\n```\n\n## Usage\n\n```golang\npackage main\n\nimport (\n  \"fmt\"\n  \"log\"\n  \"github.com/sandipmavani/hardwareid\"\n)\n\nfunc main() {\n  id, err := hardwareid.ID()\n  if err != nil {\n    log.Fatal(err)\n  }\n  fmt.Println(id)\n}\n```\n\nOr even better, use securely hashed hardware IDs:\n\n```golang\npackage main\n\nimport (\n  \"fmt\"\n  \"log\"\n  \"github.com/sandipmavani/hardwareid\"\n)\n\nfunc main() {\n  id, err := hardwareid.ProtectedID(\"myAppName\")\n  if err != nil {\n    log.Fatal(err)\n  }\n  fmt.Println(id)\n}\n```\n\n### Function: ID() (string, error)\n\nReturns original hardware address as a `string` like `MM:MM:MM:SS:SS:SS`.\n\n### Function: ProtectedID(appID string) (string, error)\n\nReturns hashed version of the hardware ID as a `string`. The hash is generated in a cryptographically secure way, using a fixed, application-specific key (calculates HMAC-SHA256 of the app ID, keyed by the hardware ID).\n\n## What you get\n\nThis package returns the hardware address mac address of your system.\n\n\nDo something along these lines:\n\n```golang\npackage main\n\nimport (\n  \"crypto/hmac\"\n  \"crypto/sha256\"\n  \"fmt\"\n  \"github.com/sandipmavani/hardwareid\"\n)\n\nconst appKey = \"WowSuchNiceApp\"\n\nfunc main() {\n  id, _ := hardwareid.ID()\n  fmt.Println(protect(appKey, id))\n  // Output: dbabdb7baa54845f9bec96e2e8a87be2d01794c66fdebac3df7edd857f3d9f97\n}\n\nfunc protect(appID, id string) string {\n  mac := hmac.New(sha256.New, []byte(id))\n  mac.Write([]byte(appID))\n  return fmt.Sprintf(\"%x\", mac.Sum(nil))\n}\n```\n\nOr simply use the convenience API call:\n\n```golang\nhashedID, err := hardwareid.ProtectedID(\"myAppName\")\n```\n\n\n## Credits\n\nThe Go gopher was created by [Denis Brodbeck](https://github.com/sandipmavani) with [gopherize.me](https://gopherize.me/), based on original artwork from [Renee French](http://reneefrench.blogspot.com/).\n\n## License\n\nThe MIT License (MIT) — [Denis Brodbeck](https://github.com/sandipmavani). Please have a look at the [LICENSE.md](LICENSE.md) for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsandipmavani%2Fhardwareid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsandipmavani%2Fhardwareid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsandipmavani%2Fhardwareid/lists"}