{"id":23419533,"url":"https://github.com/s0ssh/subnet-utils-rs","last_synced_at":"2026-01-30T09:12:43.448Z","repository":{"id":266139891,"uuid":"897514660","full_name":"s0ssh/subnet-utils-rs","owner":"s0ssh","description":"A Rust subnet utility library","archived":false,"fork":false,"pushed_at":"2024-12-02T19:58:21.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T16:54:30.330Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit-0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/s0ssh.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":"2024-12-02T19:03:13.000Z","updated_at":"2024-12-02T19:58:25.000Z","dependencies_parsed_at":"2024-12-02T20:18:37.449Z","dependency_job_id":"7a790535-e6e5-4201-9265-e859a74297b3","html_url":"https://github.com/s0ssh/subnet-utils-rs","commit_stats":null,"previous_names":["s0ssh/subnet-utils-rs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s0ssh%2Fsubnet-utils-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s0ssh%2Fsubnet-utils-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s0ssh%2Fsubnet-utils-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s0ssh%2Fsubnet-utils-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/s0ssh","download_url":"https://codeload.github.com/s0ssh/subnet-utils-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248570290,"owners_count":21126400,"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":[],"created_at":"2024-12-23T01:18:20.070Z","updated_at":"2026-01-30T09:12:43.410Z","avatar_url":"https://github.com/s0ssh.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# subnet-utils\n\nSimple IP subnet utilities\n\n\n## Usage\n\nTo use `subnet-utils`, first add this to your `Cargo.toml`:\n\n```toml\n[dependencies]\nsubnet-utils = \"0.1\"\n```\n\n\n## Examples\n\n**Check if subnet contains an address.**\n\n```rust\nuse std::net::{IpAddr, Ipv4Addr};\nuse subnet_utils::addr_in_subnet;\n\nlet res = addr_in_subnet(\u0026IpAddr::V4(Ipv4Addr::new(192, 168, 182, 1)), \"192.168.182.0/24\").unwrap();\nassert!(res);\n```\n\n**Check if any subnet contains an address.**\n\n```rust\nuse std::net::{IpAddr, Ipv4Addr};\nuse subnet_utils::addr_in_any_subnet;\n\nlet subnets = vec![\"192.168.181.0/24\", \"192.168.182.0/24\"];\nlet res = addr_in_any_subnet(\u0026IpAddr::V4(Ipv4Addr::new(192, 168, 182, 1)), \u0026subnets).unwrap();\nassert!(res);\n```\n\n**Check if all subnets contain an address.**\n\n```rust\nuse std::net::{IpAddr, Ipv4Addr};\nuse subnet_utils::addr_in_all_subnets;\n\nlet subnets = vec![\"192.168.182.0/24\", \"192.168.182.1/32\"];\nlet res = addr_in_all_subnets(\u0026IpAddr::V4(Ipv4Addr::new(192, 168, 182, 1)), \u0026subnets).unwrap();\nassert!(res);\n```\n\n**Check if any subnet contains any address.**\n\n```rust\nuse std::net::{IpAddr, Ipv4Addr};\nuse subnet_utils::any_addr_in_any_subnet;\n\nlet addrs = vec![IpAddr::V4(Ipv4Addr::new(192, 168, 182, 1)), IpAddr::V4(Ipv4Addr::new(192, 168, 182, 2))];\nlet subnets = vec![\"192.168.181.0/24\", \"192.168.182.2/32\"];\nlet res = any_addr_in_any_subnet(\u0026addrs, \u0026subnets).unwrap();\nassert!(res);\n```\n\n\n## License\n\n\u003e Copyright \u0026copy; 2024 s0s\n\nThis software is released under:\n\n- The MIT License, (http://opensource.org/licenses/MIT)\n\nPlease see the license file ([LICENSE.md](LICENSE.md)) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs0ssh%2Fsubnet-utils-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fs0ssh%2Fsubnet-utils-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs0ssh%2Fsubnet-utils-rs/lists"}