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

0.1.2 2023-12-28 11:31 UTC

This package is auto-updated.

Last update: 2025-10-22 05:51:16 UTC


README

packagist downloads min php version license tests code coverage badge lines of code

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)