wikimedia/ip-utils

Functions and constants to play with IP addresses and ranges

4.0.0 2022-01-29 17:36 UTC

This package is auto-updated.

Last update: 2023-03-12 16:11:06 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.