{"id":19607539,"url":"https://github.com/andreax79/iplib.js","last_synced_at":"2025-10-19T01:31:50.068Z","repository":{"id":4710345,"uuid":"5858138","full_name":"andreax79/iplib.js","owner":"andreax79","description":"IPlib.js is a JavaScript library very inspired by the IPlib python module useful to convert amongst many different notations and to manage couples of address/netmask in the CIDR notation.","archived":false,"fork":false,"pushed_at":"2023-01-31T21:45:05.000Z","size":150,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-06T04:10:30.326Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andreax79.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}},"created_at":"2012-09-18T15:07:32.000Z","updated_at":"2023-01-31T10:56:16.000Z","dependencies_parsed_at":"2023-02-16T18:32:14.290Z","dependency_job_id":null,"html_url":"https://github.com/andreax79/iplib.js","commit_stats":{"total_commits":16,"total_committers":2,"mean_commits":8.0,"dds":0.0625,"last_synced_commit":"36147eed837c4e15023de2076f70da39dcb570bd"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/andreax79/iplib.js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreax79%2Fiplib.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreax79%2Fiplib.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreax79%2Fiplib.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreax79%2Fiplib.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andreax79","download_url":"https://codeload.github.com/andreax79/iplib.js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreax79%2Fiplib.js/sbom","scorecard":{"id":192503,"data":{"date":"2025-08-11","repo":{"name":"github.com/andreax79/iplib.js","commit":"36147eed837c4e15023de2076f70da39dcb570bd"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"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":"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":"Code-Review","score":0,"reason":"Found 1/16 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":"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":"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":"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":"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":"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: GNU General Public License v2.0: 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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":6,"reason":"4 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5"],"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-16T21:04:11.830Z","repository_id":4710345,"created_at":"2025-08-16T21:04:11.830Z","updated_at":"2025-08-16T21:04:11.830Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279661776,"owners_count":26207107,"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","status":"online","status_checked_at":"2025-10-18T02:00:06.492Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-11T10:11:17.794Z","updated_at":"2025-10-19T01:31:50.027Z","avatar_url":"https://github.com/andreax79.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# iplib.js\n\nIPlib.js is a JavaScript library very inspired by the IPlib python module useful\nto convert amongst many different notations and to manage couples of\naddress/netmask in the CIDR notation.\n\n# Copyright\n    Copyright (c) 2012-2017 Endian S.p.A. \u003cinfo@endian.com\u003e\n    Endian S.p.A.\n    via Pillhof 47\n    39057 Appiano (BZ)\n    Italy\n\n  IPlib.js is free software: you can redistribute it and/or modify\n  it under the terms of the GNU Lesser General Public License as published\n  by the Free Software Foundation, either version 2.1 of the License, or\n  (at your option) any later version.\n\n  IPlib.js is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  GNU Lesser General Public License for more details.\n\n  You should have received a copy of the GNU Lesser General Public License\n  along with IPlib.js.  If not, see \u003chttp://www.gnu.org/licenses/\u003e. \n\n  Author: Andrea Bonomi \u003ca.bonomi@endian.com\u003e\n\n# Usage\n\nInclude the JavaScript library in your HTML markup:\n\n```\n\u003cscript type=\"text/javascript\" src=\"iplib.js\"\u003e\u003c/script\u003e\n```\n\n## CIDR\n\nCreate CIDR instances, same address, different styles:\n\n```js\nconst c = new iplib.CIDR(\"192.168.0.0/24\");\nconst d = new iplib.CIDR(\"192.168.0.0/255.255.255.0\");\nconst e = new iplib.CIDR(\"11000000101010000000000000000000/24\");\nconst f = new iplib.CIDR(\"11000000101010000000000000000000/255.255.255.0\");\nconst g = new iplib.CIDR(\"11000000101010000000000000000000/11111111111111111111111100000000\");\n\n```\n\nCompare the two CIDR object:\n\n```js\nc.equals(d)\n```\n\nGet the network IP, netmask, first IP, last IP, and broadcast address:\n\n```js\nc.getNetworkIp()\nc.getNetmask()\nc.getFirstIp()\nc.getLastIp()\nc.getBroadcastIp()\n```\n\nGet the number of IPs of the network:\n\n```js\nc.getIpNumber()\n```\n\nGet the CIDR IP address and netmask in different styles:\n```js\nc.ip.getDec() // e.g. 3232235520\nc.ip.getDot() // e.g. 192.168.0.0\nc.ip.getBin() // e.g. 11000000101010000000000000000000\nc.nm.getDec() // e.g. 4294967040\nc.nm.getDot() // e.g. 255.255.255.0\nc.nm.getBit() // e.g. 11111111111111111111111100000000\nc.nm.getBits() // e.g. 24\n```\n\nCheck if the given address in amongst the usable addresses.\n\n```js\nconst c = new iplib.CIDR(\"192.168.0.0/24\");\nc.isValidIp(\"192.168.0.2\");\n```\n\nCheck if one CIDR is contained in another one.\n\n```js\nconst c = new iplib.CIDR(\"192.168.0.0/24\");\nc.isValidIp(\"192.168.0.0/29\");\n```\n\nGet all the IP addresses.\n\n```js\nconst c = new iplib.CIDR(\"192.168.0.0/24\");\nfor (const ip of c.getAllValidIp()) {\n  console.log(ip);\n}\n```\n\n## IPv4Address\n\nCreate IPv4Address instances, same address, different styles:\n```js\nconst c = new iplib.IPv4Address(\"172.16.20.2\");\nconst d = new iplib.IPv4Address(\"172.16.20.2\", iplib.IP_DOT);\nconst e = new iplib.IPv4Address(\"10101100000100000001010000000010\");\nconst f = new iplib.IPv4Address(\"10101100000100000001010000000010\", iplib.IP_BIN);\nconst g = new iplib.IPv4Address(2886734850);\nconst h = new iplib.IPv4Address(2886734850, iplib.IP_DEC);\n\n```\n\nCompare the two IPv4Address object:\n\n```js\nc.equals(d)\n```\n\nGet the IP address in different styles:\n```js\nc.ip.getDec() // e.g. 2886734850\nc.ip.getDot() // e.g. 172.16.20.2\nc.ip.getBin() // e.g. 10101100000100000001010000000010\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreax79%2Fiplib.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandreax79%2Fiplib.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreax79%2Fiplib.js/lists"}