8ctopus / nano-ip
experimental ip address library
Installs: 96
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/8ctopus/nano-ip
Requires
- php: >=8.1
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.8
- phpmd/phpmd: ^2.13
- phpstan/phpstan: ^1.9
- phpunit/phpunit: ^9.5|^10.0
This package is auto-updated.
Last update: 2025-10-22 05:51:16 UTC
README
Experimental package to check if an IPv4 ip address is in a list of ranges.
features
- CIDR ranges
install
composer require 8ctopus/nano-ip
example
use Oct8pus\NanoIP\CIDR; require_once __DIR__ . '/vendor/autoload.php'; $range = '192.168.100.0/22'; $range = new CIDRRange($range); echo $range;
192.168.100.0/22 range contains 1024 addresses 192.168.100.0 - 192.168.103.255
Test CIDR ranges online Understand CIDR notation More info IP v6
run tests
composer test
clean code
composer fix(-risky)