wikimedia/ip-utils

Functions and constants to play with IP addresses and ranges

1.0.0 2019-06-25 17:43 UTC

README

Latest Stable Version License

IPUtils

A series of utilities for working with IP addresses, both IPv4 and IPv6.

Additional documentation about the library can be found on MediaWiki.org.

Usage

use Wikimedia\IPUtils;

IPUtils::isIPAddress( '::1' );
IPUtils::isIPv4( '124.24.52.13' );

Running tests

composer install --prefer-dist
composer test

History

This library was first introduced in MediaWiki 1.7 (r15572). It was split out of the MediaWiki codebase and published as an independent library during the MediaWiki 1.34 development cycle.