8ctopus / nano-ip
experimental ip address library
0.1.2
2023-12-28 11:31 UTC
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: 2024-10-26 14:59:55 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)