{"id":15026434,"url":"https://github.com/sikofitt/generate-mac","last_synced_at":"2026-04-22T07:03:50.014Z","repository":{"id":54893173,"uuid":"159701239","full_name":"sikofitt/generate-mac","owner":"sikofitt","description":"PHP \u003e=8.2 library to generate private mac addresses","archived":false,"fork":false,"pushed_at":"2025-09-24T19:15:57.000Z","size":57,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"2.1.x-dev","last_synced_at":"2025-10-29T11:47:04.445Z","etag":null,"topics":["generate","mac","macaddress","network","php","php8"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sikofitt.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-11-29T17:11:09.000Z","updated_at":"2025-09-24T19:07:14.000Z","dependencies_parsed_at":"2024-09-28T20:00:28.784Z","dependency_job_id":null,"html_url":"https://github.com/sikofitt/generate-mac","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/sikofitt/generate-mac","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sikofitt%2Fgenerate-mac","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sikofitt%2Fgenerate-mac/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sikofitt%2Fgenerate-mac/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sikofitt%2Fgenerate-mac/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sikofitt","download_url":"https://codeload.github.com/sikofitt/generate-mac/tar.gz/refs/heads/2.1.x-dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sikofitt%2Fgenerate-mac/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29661601,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T16:33:43.953Z","status":"ssl_error","status_checked_at":"2026-02-20T16:33:43.598Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["generate","mac","macaddress","network","php","php8"],"created_at":"2024-09-24T20:04:27.866Z","updated_at":"2026-04-22T07:03:49.991Z","avatar_url":"https://github.com/sikofitt.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sikofitt/generate-mac\n\n### Small library to generate unique private mac addresses\n\n#### Install\n\nRequires PHP \u003e=8.2,  For versions compatible with PHP 7.x use the 0.x branch.\n\n[composer](https://getcomposer.org)\n```bash\ncomposer require sikofitt/generate-mac\n```\n\n#### Usage\n```php\nuse Sikofitt\\GenerateMac\\Mac;\n\n$mac = new Mac(); // default separator is ':'\n// or\n$mac-\u003esetSeparator(Mac::SEPARATOR_COLON);\n$address = $mac-\u003egetAddress(); // ab:cd:ef:01:23:45\n\n$mac = new Mac(Mac::SEPARATOR_DASH);\n// or\n$mac-\u003esetSeparator(Mac::SEPARATOR_DASH);\n$address = $mac-\u003egetAddress(); // ab-cd-ef-01-23-45\n\n$mac = new Mac(Mac::SEPARATOR_NONE);\n// or\n$mac-\u003esetSeparator(Mac::SEPARATOR_NONE);\n$address = $mac-\u003egetAddress(); // abcdef012345\n```\n\nIf you don't care that it is unique you can remove the check for private mac prefixes.\n\n```php\n$mac = new Mac(Mac::SEPARATOR_COLON, false);\n// or\n$mac-\u003esetUnique(false);\n\n$address = $mac-\u003egetAddress();\n\n// '52:54:00:ab:cd:ef',  QEMU virtual NIC prefix 52:54:00\n// It's really not likely there will be a collision though.\n```\n\nGenerate multiple mac addresses\n```php\n$addresses = $mac-\u003egetAddresses(10);\n\nvar_dump($addresses);\n/*\n *   array (\n *       0 =\u003e '8a:20:0b:b7:c4:62',\n *       1 =\u003e '56:7d:47:56:e8:bd',\n *       2 =\u003e '2a:ae:7b:44:6f:9d',\n *       3 =\u003e '6a:36:1a:7c:04:3a',\n *       4 =\u003e '3a:3d:93:f5:a6:12',\n *       5 =\u003e '8a:85:ce:11:2c:a2',\n *       6 =\u003e '06:54:6f:b1:11:48',\n *       7 =\u003e 'c6:fe:9d:86:38:dd',\n *       8 =\u003e 'ba:39:b3:a2:a1:fa',\n *       9 =\u003e '32:73:c0:b3:62:27',\n *   );\n */\n\n// if you call this with 1 as the count it will still\n// return an array [0 =\u003e '32:73:c0:b3:62:27']\n```\n\n#### Using the console component\n\nThe console script requires [symfony/console](https://symfony.com/doc/current/components/console.html \"Symfony Console Component\")\n```bash\nuser@localhost:~/generate-mac$ bin/generate-mac --count (int) --output (json|plain|string) --separator (none|colon|dash)\n```\n  * --count Generate {count} mac addresses\n  * --output Output in selected format\n    * string: (default) Outputs the mac address(es) with formatting\n    * plain:  Outputs the mac address(es) with no formatting\n    * json:   Output the mac address(es) in json format\n  * --separator Outputs with the selected operator\n    * colon: ':' (default)\n    * dash:  '-'\n    * none:  ''\n\n_See bin/generate-mac --help_\n\n\n#### Test\n\n```bash\nuser@localhost:~/generate-mac$ vendor/bin/phpunit\n```\n\n#### License\n\n[GPL-3.0](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsikofitt%2Fgenerate-mac","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsikofitt%2Fgenerate-mac","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsikofitt%2Fgenerate-mac/lists"}