PHPackages                             cmdrsharp/ip-addressing - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. cmdrsharp/ip-addressing

ActiveLibr[Utility &amp; Helpers](/categories/utility)

cmdrsharp/ip-addressing
=======================

A collection of traits for IP Operations.

1.2.0.0(6y ago)011MITPHPPHP &gt;=7.1

Since Aug 21Pushed 6y ago1 watchersCompare

[ Source](https://github.com/CmdrSharp/ip-addressing)[ Packagist](https://packagist.org/packages/cmdrsharp/ip-addressing)[ RSS](/packages/cmdrsharp-ip-addressing/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (3)Dependencies (1)Versions (5)Used By (0)

About
=====

[](#about)

[![Latest Stable Version](https://camo.githubusercontent.com/5efc3425d5607cadcbbbcc4c6247acb1f58212c1a6418131362cc6524faa41e4/68747470733a2f2f706f7365722e707567782e6f72672f636d647273686172702f69702d61646472657373696e672f762f737461626c65)](https://packagist.org/packages/cmdrsharp/ip-addressing)[![Build Status](https://camo.githubusercontent.com/980969bc5fc07bba06a41895d67470bfff1669fdc61b6b66593c412c611b5252/68747470733a2f2f7472617669732d63692e6f72672f436d647253686172702f69702d61646472657373696e672e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/CmdrSharp/ip-addressing)[![StyleCI](https://camo.githubusercontent.com/cbbf6d1d3f9182f94f1540fcd6ba9a0b51f3a23fdb1de9950b5640bc2a164f68/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3230333538343133332f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/203584133)[![MIT licensed](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](./LICENSE)

A collection of traits for general IP operations. New traits may be added over time.

Current Requirements
====================

[](#current-requirements)

- PHP 7.1 or newer

Installation
============

[](#installation)

Via composer

```
$ composer require cmdrsharp/ip-addressing
```

Usage
=====

[](#usage)

Use the applicable Trait in your classes.

```
use CmdrSharp\IpAddressing\IPv4;
use CmdrSharp\IpAddressing\Subnet;

class RandomClass
{
	use IPv4, Subnet;

	protected function randomFunction()
	{
		$result = $this->getNetworkFromIp('192.168.0.55', '255.255.255.0');
		// 192.168.0.0

		$result = $this->getBroadcastFromIp('192.168.0.55', '255.255.255.0');
        // 192.168.0.255

		$result = $this->getCidrFromNetmask('255.255.255.0');
		// 24
	}
}
```

What trait contains what?
-------------------------

[](#what-trait-contains-what)

#### IPv4

[](#ipv4)

- `getNetworkFromIp(string $ip, string $netmask): string`
- `getBroadcastFromIp(string $ip, string $netmask): string`

#### Subnet

[](#subnet)

- `getCidrFromNetmask(string $netmask): string`

Versioning
==========

[](#versioning)

This package follows [Explicit Versioning](https://github.com/exadra37-versioning/explicit-versioning).

Authors
=======

[](#authors)

[CmdrSharp](https://github.com/CmdrSharp)

License
=======

[](#license)

[The MIT License (MIT)](LICENSE)

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

2505d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5938745?v=4)[Marcus Frolander](/maintainers/CmdrSharp)[@CmdrSharp](https://github.com/CmdrSharp)

---

Top Contributors

[![CmdrSharp](https://avatars.githubusercontent.com/u/5938745?v=4)](https://github.com/CmdrSharp "CmdrSharp (12 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cmdrsharp-ip-addressing/health.svg)

```
[![Health](https://phpackages.com/badges/cmdrsharp-ip-addressing/health.svg)](https://phpackages.com/packages/cmdrsharp-ip-addressing)
```

###  Alternatives

[verbb/field-manager

Manage your fields and field groups with ease.

195612.2k10](/packages/verbb-field-manager)[savannabits/filament-flatpickr

Flatpickr input for Filamentphp

10156.3k](/packages/savannabits-filament-flatpickr)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
