REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 2.56 KB
Close
/home/nshryvcy/blissfulnepal.com/wp-content/plugins/wordfence/vendor/wordfence/mmdb-reader/src/IpAddress.php
Text
Base64
<?php namespace Wordfence\MmdbReader; use Wordfence\MmdbReader\Exception\InvalidIpAddressException; class IpAddress implements IpAddressInterface { const TYPE_IPV4 = 4; const TYPE_IPV6 = 6; const LENGTH_IPV4 = 4; const LENGTH_IPV6 = 16; const SEPARATOR_IPV4 = '.'; const SEPARATOR_IPV6 = ':'; private static $SEPARATORS = array( self::SEPARATOR_IPV4, self::SEPARATOR_IPV6 ); private $humanReadable; private $binary; private $type; protected function __construct($humanReadable, $binary) { $this->humanReadable = $humanReadable; $this->binary = $binary; $this->type = self::resolveType($binary); } public function getHumanReadable() { return $this->humanReadable; } public function getBinary() { return $this->binary; } public function getType() { return $this->type; } private static function resolveType($binary) { return strlen($binary) === self::LENGTH_IPV6 ? self::TYPE_IPV6 : self::TYPE_IPV4; } /** * Create an IpAddress instance from a human-readable string * @param string $humanReadable a human readable IP address * @return IpAddress * @throws InvalidIpAddressException if $humanReadable is not a valid human-readable IP address */ public static function createFromHumanReadable($humanReadable) { $binary = inet_pton($humanReadable); if ($binary === false) throw new InvalidIpAddressException("IP address \"{$humanReadable}\" is malformed"); return new self($humanReadable, $binary); } /** * Create an IpAddress instance from a binary string * @param string $binary a binary IP address * @return IpAddress * @throws InvalidIpAddressException if $binary is not a valid binary IP address */ public static function createFromBinary($binary) { $humanReadable = inet_ntop($binary); if ($humanReadable === false) throw new InvalidIpAddressException("Binary IP address data is invalid: " . bin2hex($binary)); return new self($humanReadable, $binary); } /** * Create an IpAddress instance from an unknown string representation * @param string $string either a human-readable or binary IP address * @return IpAddress * @throws InvalidIpAddressException if $string cannot be parsed as a valid IP address */ public static function createFromString($string) { foreach (self::$SEPARATORS as $separator) { if (strpos($string, $separator) !== false) { try { return self::createFromHumanReadable($string); } catch (InvalidIpAddressException $e) { break; } } } return self::createFromBinary($string); } public function __toString() { return $this->getHumanReadable(); } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 2 × Files: 11
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
Exception
DIR
-
drwxr-xr-x
2026-06-03 14:57:34
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Io
DIR
-
drwxr-xr-x
2026-06-03 14:57:34
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ControlByte.php
2.50 KB
lrw-r--r--
2026-06-03 14:57:34
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Database.php
6.02 KB
lrw-r--r--
2026-06-03 14:57:34
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
DatabaseMetadata.php
1.87 KB
lrw-r--r--
2026-06-03 14:57:34
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
DataFieldParser.php
4.99 KB
lrw-r--r--
2026-06-03 14:57:34
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Endianness.php
699 B
lrw-r--r--
2026-06-03 14:57:34
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
IntegerParser.php
265 B
lrw-r--r--
2026-06-03 14:57:34
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
IpAddress.php
2.56 KB
lrw-r--r--
2026-06-03 14:57:34
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
IpAddressInterface.php
497 B
lrw-r--r--
2026-06-03 14:57:34
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Node.php
566 B
lrw-r--r--
2026-06-03 14:57:34
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
NodeReader.php
2.04 KB
lrw-r--r--
2026-06-03 14:57:34
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
NodeRecord.php
1.22 KB
lrw-r--r--
2026-06-03 14:57:34
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).