PHPackages                             ossinkine/pseudo-ipv4 - 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. ossinkine/pseudo-ipv4

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

ossinkine/pseudo-ipv4
=====================

Converts IPv6 address to Pseudo IPv4 (valid IPv4 address in Class E space)

v1.1.0(5y ago)841.2k—0.9%1MITPHPPHP ^7.3 || ^8.0

Since Apr 29Pushed 5y ago1 watchersCompare

[ Source](https://github.com/ossinkine/pseudo-ipv4)[ Packagist](https://packagist.org/packages/ossinkine/pseudo-ipv4)[ RSS](/packages/ossinkine-pseudo-ipv4/feed)WikiDiscussions master Synced 1mo ago

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

Pseudo IPv4
===========

[](#pseudo-ipv4)

[![Build Status](https://camo.githubusercontent.com/3ab994e1dfd20430b1dd0f37e5eb3442a1304d0d948d2c1ee4e1a68f487ceb2b/68747470733a2f2f7472617669732d63692e6f72672f6f7373696e6b696e652f70736575646f2d697076342e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/ossinkine/pseudo-ipv4)

Pseudo IPv4 is a library which converts IPv6 address to IPv4 in Class E space (240.0.0.0 - 255.255.255.255). It can be helpful if your app operates with IPv4 only but the customer uses IPv6. For more information see [CloudFlare solution](https://blog.cloudflare.com/eliminating-the-last-reasons-to-not-enable-ipv6/)

How it works
------------

[](#how-it-works)

Pseudo IPv4 determines if given address is 6to4 and gets original IPv4. Otherwise it gets 8 first bytes from given IPv6 address and converts them to 4 bytes.

Installation
------------

[](#installation)

```
composer require ossinkine/pseudo-ipv4
```

Usage
-----

[](#usage)

Create a converter instance and pass an IPv6 address into it.

```
use Ossinkine\PseudoIpv4\PseudoIpv4Converter;

$ipv6 = '2001:0db8:11a3:09d7:1f34:8a2e:07a0:765d';
$converter = new PseudoIpv4Converter();
$ipv4 = $converter->convert($ipv6);
```

If you unsure the address is IPv6 you can catch an appropriate exception.

```
use Ossinkine\PseudoIpv4\Exception\WrongIpv6Exception;
use Ossinkine\PseudoIpv4\PseudoIpv4Converter;

$ip = $_SERVER['REMOTE_ADDR'];
$converter = new PseudoIpv4Converter();
try {
    $ipv4 = $converter->convert($ip);
} catch (WrongIpv6Exception $exception) {
    $ipv4 = $ip;
}
```

License
-------

[](#license)

[Pseudo IPv4](https://github.com/ossinkine/pseudo-ipv4) is licensed under the [MIT license](LICENSE).

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 92.3% 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 ~560 days

Total

2

Last Release

2016d ago

PHP version history (2 changes)v1.0.0PHP ^7.0

v1.1.0PHP ^7.3 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/cf9c00e84cec1d3a5b39105ecf8093c44529e1b1166673e2ea6106bf80edb09e?d=identicon)[ossinkine](/maintainers/ossinkine)

---

Top Contributors

[![ossinkine](https://avatars.githubusercontent.com/u/2588533?v=4)](https://github.com/ossinkine "ossinkine (12 commits)")[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ossinkine-pseudo-ipv4/health.svg)

```
[![Health](https://phpackages.com/badges/ossinkine-pseudo-ipv4/health.svg)](https://phpackages.com/packages/ossinkine-pseudo-ipv4)
```

###  Alternatives

[e0ipso/schema-forms

Creates form definitions from JSON Schema property definitions and display configuration.

11219.1k](/packages/e0ipso-schema-forms)

PHPackages © 2026

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