All Projects → geertw → php-ip-anonymizer

geertw / php-ip-anonymizer

Licence: MIT license
IP address anonymizer library for PHP

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to php-ip-anonymizer

ip2location-nginx
Nginx module that allows user to lookup for geolocation information using IP2Location database.
Stars: ✭ 33 (-40%)
Mutual labels:  ipv6, ipv4, ip-address
IPpy
🚀 Ping IP addresses and domains in parallel to find the accessible and inaccessible ones.
Stars: ✭ 54 (-1.82%)
Mutual labels:  ipv6, ipv4, ip-address
IP2Location-C-Library
IP2Location C library enables the user to find the country, region, city, coordinates, zip code, time zone, ISP, domain name, connection type, area code, weather station code, weather station name, mobile, usage types, etc that any IP address or hostname originates from.
Stars: ✭ 37 (-32.73%)
Mutual labels:  ipv6, ipv4, ip-address
ipapi-python
Python bindings for https://ipapi.co (IP Address Location) - Use with python / django / flask for IP address location lookup
Stars: ✭ 42 (-23.64%)
Mutual labels:  ipv6, ipv4, ip-address
Ipwhois
Retrieve and parse whois data for IPv4 and IPv6 addresses
Stars: ✭ 432 (+685.45%)
Mutual labels:  ipv6, ipv4, ip-address
PHP-IPAddress
IP Address utility classes for PHP
Stars: ✭ 63 (+14.55%)
Mutual labels:  ipv6, ipv4, ip-address
ipaddress
Data analysis of IP addresses and networks
Stars: ✭ 20 (-63.64%)
Mutual labels:  ipv6, ipv4, ip-address
private-ip
Check if IP address is private.
Stars: ✭ 26 (-52.73%)
Mutual labels:  ipv6, ipv4, ip-address
ip
Immutable value object for IPv4 and IPv6 addresses, including helper methods and Doctrine support.
Stars: ✭ 212 (+285.45%)
Mutual labels:  ipv6, ipv4, ip-address
Geolocate-IP-Browser-Extension
A browser extension, which shows you the origin of your IP address.
Stars: ✭ 21 (-61.82%)
Mutual labels:  ipv6, ipv4, ip-address
IP2Location-PHP-Module
This module is a PHP module that enables the user to find the country, region, city, coordinates, zip code, ISP, domain name, timezone, connection speed, IDD code, area code, weather station code, weather station name, mobile, usage types, address type, IAB category, etc that any IP address or host name originates from.
Stars: ✭ 154 (+180%)
Mutual labels:  ipv6, ipv4, ip-address
Ip Num
A TypeScript/JavaScript library for working with ASN, IPv4, and IPv6 numbers. It provides representations of these internet protocol numbers with the ability to perform various IP related operations like parsing, validating etc. on them
Stars: ✭ 113 (+105.45%)
Mutual labels:  ipv6, ipv4, ip-address
Ipnetwork
A library to work with CIDRs in rust
Stars: ✭ 64 (+16.36%)
Mutual labels:  ipv6, ipv4, ip-address
Ipaddress
Java library for handling IP addresses and subnets, both IPv4 and IPv6
Stars: ✭ 197 (+258.18%)
Mutual labels:  ipv6, ipv4, ip-address
vertx-ddns
基于 Vert.x 的 DDNS 解决方案。自动更新域名解析到本机IP, 支持的DNS服务商: Alidns(阿里云) 、 Dnspod(腾讯云) 、Cloudflare、华为云
Stars: ✭ 126 (+129.09%)
Mutual labels:  ipv6, ipv4
netcalc
Advanced network calculator and address planning helper
Stars: ✭ 20 (-63.64%)
Mutual labels:  ipv6, ipv4
node-ip2region
IP/IPv6 to region on Node.js (IP/IPv6 地址到区域运营商)
Stars: ✭ 95 (+72.73%)
Mutual labels:  ipv6, ip-address
fakeroute
IPv4 and IPv6 traceroute fake hop generator through IP spoofing
Stars: ✭ 75 (+36.36%)
Mutual labels:  ipv6, ipv4
go-external-ip
a Golang library to get your external ip from multiple services
Stars: ✭ 55 (+0%)
Mutual labels:  ipv6, ipv4
ip-finder-cli
The official command line client for IPFinder
Stars: ✭ 11 (-80%)
Mutual labels:  ipv6, ipv4

Latest Stable Version Total Downloads License

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 2a03:2880:2110:df07::.

Example

<?php
use geertw\IpAnonymizer\IpAnonymizer;
require 'vendor/autoload.php';

$ipAnonymizer = new IpAnonymizer();

var_dump($ipAnonymizer->anonymize('127.0.0.1'));
// returns 127.0.0.0

var_dump($ipAnonymizer->anonymize('192.168.178.123'));
// returns 192.168.178.0

var_dump($ipAnonymizer->anonymize('8.8.8.8'));
// returns 8.8.8.0

var_dump($ipAnonymizer->anonymize('::1'));
// returns ::

var_dump($ipAnonymizer->anonymize('::127.0.0.1'));
// returns ::

var_dump($ipAnonymizer->anonymize('2a03:2880:2110:df07:face:b00c::1'));
// returns 2a03:2880:2110:df07::

var_dump($ipAnonymizer->anonymize('2610:28:3090:3001:dead:beef:cafe:fed3'));
// returns 2610:28:3090:3001::

// Use a custom mask:
$ipAnonymizer->ipv4NetMask = "255.255.0.0";
var_dump($ipAnonymizer->anonymize('192.168.178.123'));
// returns 192.168.0.0

// You can use this class also in a static way:
var_dump(IpAnonymizer::anonymizeIp('192.168.178.123'));
// returns 192.168.178.0

var_dump(IpAnonymizer::anonymizeIp('2610:28:3090:3001:dead:beef:cafe:fed3'));
// returns 2610:28:3090:3001::

License

This library is licensed under the MIT License. See the LICENSE file for the full license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].