PHPackages                             potaka/ip-anonymizer - 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. potaka/ip-anonymizer

ActiveLibrary

potaka/ip-anonymizer
====================

IPv4 and IPv6 address anonymizer

2.0.0(7y ago)0647MITPHPPHP &gt;=7.1

Since Oct 27Pushed 7y ago1 watchersCompare

[ Source](https://github.com/angelk/php-ip-anonymizer)[ Packagist](https://packagist.org/packages/potaka/ip-anonymizer)[ RSS](/packages/potaka-ip-anonymizer/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (1)Versions (4)Used By (0)

[![Build Status](https://camo.githubusercontent.com/bce4fad08152ed4e6bbef6bcf6fe06870949f90f7d26e3bb16e2cb7a18083531/68747470733a2f2f7472617669732d63692e6f72672f616e67656c6b2f7068702d69702d616e6f6e796d697a65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/angelk/php-ip-anonymizer)

IP address anonymizer for PHP
=============================

[](#ip-address-anonymizer-for-php)

This is a library for PHP to anonymize IP addresses. This makes it easier to respect user privacy, and it makes it more difficult to identify an end user by his IP address. Anonymizing IP addresses can be useful for a lot of cases where the exact IP address is not important or even undesired, for example in a statistical analysis.

This library supports both IPv4 and IPv6 addresses. Addresses are anonymized to their network ID.

The default settings anonymize an IP address to a /24 subnet (IPv4) or a /64 subnet (IPv6), but these can be customized.

For instance, the IPv4 address `192.168.178.123` is anonymized by default to `192.168.178.0`.

The IPv6 address `2a03:2880:2110:df07:face:b00c::1` is anonymized by default to `2610:28:3090:3001::`.

Example
-------

[](#example)

```
