{"id":15344265,"url":"https://github.com/humbedooh/lua-cidr","last_synced_at":"2025-08-27T05:10:33.300Z","repository":{"id":139583875,"uuid":"389096437","full_name":"Humbedooh/lua-cidr","owner":"Humbedooh","description":"Simple CIDR block matching library for Lua","archived":false,"fork":false,"pushed_at":"2021-07-24T17:27:48.000Z","size":20,"stargazers_count":0,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-27T18:52:37.822Z","etag":null,"topics":["cidr","ip","lua","network"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Humbedooh.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":"2021-07-24T12:41:43.000Z","updated_at":"2024-12-06T14:31:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"c174d378-0c20-47c2-bdf3-80abb682c76e","html_url":"https://github.com/Humbedooh/lua-cidr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Humbedooh/lua-cidr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Humbedooh%2Flua-cidr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Humbedooh%2Flua-cidr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Humbedooh%2Flua-cidr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Humbedooh%2Flua-cidr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Humbedooh","download_url":"https://codeload.github.com/Humbedooh/lua-cidr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Humbedooh%2Flua-cidr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272293945,"owners_count":24908722,"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-08-27T02:00:09.397Z","response_time":76,"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":["cidr","ip","lua","network"],"created_at":"2024-10-01T10:56:11.190Z","updated_at":"2025-08-27T05:10:33.261Z","avatar_url":"https://github.com/Humbedooh.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lua-cidr\nSimple CIDR block matching library for Lua 5.1 and above\n\n## Usage:\n\n`cidr` works with both IPv4 and Ipv6.\n\nRequires the bitwise operator (`bitop`) library in order to work with Lua 5.1, 5.2 or LuaJIT. When Lua 5.3, it uses the native bitwise operators.\n\n\nIPv4 example:\n\n~~~lua\nlocal cidr = import 'cidr'\nlocal network = cidr:network('127.0.0.1/25')\nlocal my_ip = '127.0.0.65'\nlocal outside_ip = '1.2.3.4'\n\nassert(network.ipv4) -- network is ipv4\nassert(not network.ipv6) -- network is not ipv6\nassert(network:match(my_ip)) -- my_ip is within network range\nassert(not network:match(outside_ip)) -- outside_ip is not within network range\n~~~\n\nIPv6 example:\n\n~~~lua\nlocal cidr = require 'cidr'\nlocal network = cidr:network(\"2001:dead:beef::1/48\")\nlocal my_ip = \"2001:dead:beef::2\"\nassert(network.ipv6) -- network is ipv6\nassert(not network.ipv4) -- is not ipv4\nassert(network:match(my_ip)) -- my_ip is within network range\n~~~\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhumbedooh%2Flua-cidr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhumbedooh%2Flua-cidr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhumbedooh%2Flua-cidr/lists"}