A library for IP addresses calculations

Overview

PHP IP tools

GitHub Actions Infection MSI

This library provides tooling for IP address calculations based on rlanvin/php-ip

Free IP blocks calculation

Compute the best possible aligned IP blocks within a given range, excluding the taken blocks or IP addresses.

Example:

$block = '192.168.0.0/24';
$taken = ['192.168.0.64/28'];

$calculator = new IpBlocksCalculator();
$free = $calculator->__invoke($block, $taken);

var_dump($free);
/*
 *  [
 *    '192.168.0.0/26',
 *    '192.168.0.80/28',
 *    '192.168.0.96/27',
 *    '192.168.0.128/25',
 *   ]
 */

See more examples in IpBlocksCalculatorTest.

IP ranges parsing

Parse fuzzy IP address block definitions and unwrap it to an array:

Example:

IpRangeParser::fromString('192.0.2.[1,2,100-250]/24');
// ['192.0.2.1/24', '192.0.2.2/24', '192.0.2.100/24' ... '192.0.2.250/24']

See more examples in IpRangeParserTest.

You might also like...
Simple library that abstracts different metrics collectors. I find this necessary to have a consistent and simple metrics (functional) API that doesn't cause vendor lock-in.

Metrics Simple library that abstracts different metrics collectors. I find this necessary to have a consistent and simple metrics API that doesn't cau

Sslurp is a simple library which aims to make properly dealing with SSL in PHP suck less.

Sslurp v1.0 by Evan Coury Introduction Dealing with SSL properly in PHP is a pain in the ass and completely insecure by default. Sslurp aims to make i

FuelPHP Framework - Class and Namespace alias library

Fuel Alias Library for lazy class aliasing. Install Via Composer $ composer require fuelphp/alias Usage Within FuelPHP class aliases are used to provi

A framework agnostic PHP library to build chat bots
A framework agnostic PHP library to build chat bots

BotMan If you want to learn how to create reusable PHP packages yourself, take a look at my upcoming PHP Package Development video course. About BotMa

Lock library to provide serialized execution of PHP code.

Requirements | Installation | Usage | License and authors | Donations php-lock/lock This library helps executing critical code in concurrent situation

PHP Machine Learning library
PHP Machine Learning library

PHP-ML - Machine Learning library for PHP Fresh approach to Machine Learning in PHP. Algorithms, Cross Validation, Neural Network, Preprocessing, Feat

A framework agnostic, multi-gateway payment processing library for PHP 5.6+

Omnipay An easy to use, consistent payment processing library for PHP Omnipay is a payment processing library for PHP. It has been designed based on i

PHP library providing retry functionality with multiple backoff strategies and jitter support

PHP Backoff Easily wrap your code with retry functionality. This library provides: 4 backoff strategies (plus the ability to use your own) Optional ji

A laravel library or package for mpesa - Tanzania
A laravel library or package for mpesa - Tanzania

THIS PACKAGE IS YET TO BE READY JUST A SKELETON This package is created to help developers intergrate with Vodacom Mpesa Tanzania open api. More infor

Releases(1.1.0)
Owner
HiQDev
We are making HiPanel
HiQDev
Dobren Dragojević 6 Jun 11, 2023
:date: The VObject library for PHP allows you to easily parse and manipulate iCalendar and vCard objects

sabre/vobject The VObject library allows you to easily parse and manipulate iCalendar and vCard objects using PHP. The goal of the VObject library is

sabre.io 532 Dec 25, 2022
Small convention based CQRS library for PHP

LiteCQRS for PHP Small naming-convention based CQRS library for PHP (loosely based on LiteCQRS for C#) that relies on the MessageBus, Command, EventSo

Benjamin Eberlei 560 Nov 20, 2022
Experimental library for forking PHP

Spork: PHP on a Fork <?php $manager = new Spork\ProcessManager(); $manager->fork(function() { // do something in another process! return 'Hel

Kris Wallsmith 588 Nov 20, 2022
Collection pipeline library for PHP

Knapsack Collection pipeline library for PHP Knapsack is a collection library for PHP >= 5.6 that implements most of the sequence operations proposed

Dušan Kasan 540 Dec 17, 2022
Easy to use utility functions for everyday PHP projects. This is a port of the Lodash JS library to PHP

Lodash-PHP Lodash-PHP is a port of the Lodash JS library to PHP. It is a set of easy to use utility functions for everyday PHP projects. Lodash-PHP tr

Lodash PHP 474 Dec 31, 2022
A PHP library to play with the Raspberry PI's GPIO pins

php-gpio php-gpio is a simple PHP library to play with the Raspberry PI's GPIO pins. It provides simple tools such as reading & writing to pins. [UPDA

Ronan Guilloux 266 Oct 17, 2022
PHP library for dealing with European VAT

ibericode/vat This is a simple PHP library to help you deal with Europe's VAT rules. Fetch VAT rates for any EU member state using ibericode/vat-rates

ibericode 389 Dec 31, 2022
Michael Pratt 307 Dec 23, 2022
iOS passbook library for PHP 5.4+

PHP PASSBOOK LIBRARY What is Passbook? Passbook is an application in iOS that allows users to store coupons, boarding passes, event tickets, store car

Eymen Gunay 256 Nov 17, 2022