{"id":41247044,"url":"https://github.com/m7shapan/cidr","last_synced_at":"2026-01-23T01:29:21.669Z","repository":{"id":124077986,"uuid":"258865600","full_name":"m7shapan/cidr","owner":"m7shapan","description":"get more IP details from CIDR range","archived":false,"fork":false,"pushed_at":"2020-04-27T12:48:41.000Z","size":5,"stargazers_count":27,"open_issues_count":0,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-06-18T23:15:18.402Z","etag":null,"topics":["cidr","cidr-range","go","golang","ip"],"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/m7shapan.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":"2020-04-25T20:16:09.000Z","updated_at":"2023-10-23T21:30:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"7bcddfa8-677b-4e3a-a526-409fe688e4e8","html_url":"https://github.com/m7shapan/cidr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/m7shapan/cidr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m7shapan%2Fcidr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m7shapan%2Fcidr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m7shapan%2Fcidr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m7shapan%2Fcidr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/m7shapan","download_url":"https://codeload.github.com/m7shapan/cidr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m7shapan%2Fcidr/sbom","scorecard":{"id":608646,"data":{"date":"2025-08-11","repo":{"name":"github.com/m7shapan/cidr","commit":"7eba0889a5d24783b2001b4138c305c301796a2c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/5 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T02:09:22.758Z","repository_id":124077986,"created_at":"2025-08-21T02:09:22.765Z","updated_at":"2025-08-21T02:09:22.765Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28677502,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T01:00:35.747Z","status":"ssl_error","status_checked_at":"2026-01-23T01:00:19.529Z","response_time":144,"last_error":"SSL_read: 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":["cidr","cidr-range","go","golang","ip"],"created_at":"2026-01-23T01:29:21.574Z","updated_at":"2026-01-23T01:29:21.648Z","avatar_url":"https://github.com/m7shapan.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CIDR (Classless inter-domain routing)\n\nThis Package converts IP CIDR to range and return First IP, Last IP, First IP decimal, Last IP decimal and Total Host count for IPv4 and IPv6\n\n## Install\n`go get -u github.com/m7shapan/cidr`\n\n## How to use\n See [the GoDoc](https://pkg.go.dev/github.com/m7shapan/cidr)\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/m7shapan/cidr\"\n)\n\nfunc main() {\n\tp, err := cidr.ParseCIDR(\"1.0.0.0/24\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tfmt.Println(\"First IP:\", p.FirstIP)\n\tif p.IsIPv4 {\n\t\tfmt.Println(\"First IP (Decimal):\", p.FirstIPv4())\n\t} else {\n\t\tfmt.Println(\"First IP (Decimal):\", p.FirstIPv6())\n\t}\n\n\tfmt.Println(\"Last IP:\", p.LastIP)\n\n\tif p.IsIPv4 {\n\t\tfmt.Println(\"Last IP (Decimal):\", p.LastIPv4())\n\t} else {\n\t\tfmt.Println(\"Last IP (Decimal):\", p.LastIPv6())\n\t}\n\n\tif p.IsIPv4 {\n\t\tfmt.Println(\"Total Host:\", p.HostCountIPv4())\n\t} else {\n\t\tfmt.Println(\"Total Host:\", p.HostCountIPv6())\n\t}\n\n\t// First IP: 1.0.0.0\n\t// First IP (Decimal): 16777216\n\t// Last IP: 1.0.0.255\n\t// Last IP (Decimal): 16777471\n\t// Total Host: 256\n\n\n\tip := net.ParseIP(\"1.0.0.0\")\n\tfmt.Println(IPv4tod(ip)) // 16777216\n\n\tip := net.ParseIP(\"2001:4860:4860::8888\")\n\tfmt.Println(IPv6tod(ip)) // 42541956123769884636017138956568135816\n\n\tvar i uint32 = 16777216\n\tfmt.Println(DtoIPv4(i)) // 1.0.0.0\n\n\tb := new(big.Int)\n\tb.SetString(\"42541956123769884636017138956568135816\", 10)\n\tfmt.Println(DtoIPv6(b)) // 2001:4860:4860::8888\n\n}\n```\n\n## Package usage for SEO\n- get ip from ip range\n- convert ip range to ip\n- golang convert ip range to decimal\n- How to get first/last IP address of CIDR\n- Convert IP version 6 address to integer or decimal number\n- IPv4 to IP Decimal Conversion\n- ipv4 to decimal golang","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm7shapan%2Fcidr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm7shapan%2Fcidr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm7shapan%2Fcidr/lists"}