summaryrefslogtreecommitdiff
path: root/vendor/mlocati/ip-lib/src/Address/IPv6.php
diff options
context:
space:
mode:
authorGreg Roach <greg@subaqua.co.uk>2021-01-25 09:14:24 +0000
committerGreg Roach <greg@subaqua.co.uk>2021-01-25 09:54:14 +0000
commitb4669828ea95f526aca6b57eb56d46911d6b16f0 (patch)
tree702f58468af626ce0ddd44ddb0801b3567170ce7 /vendor/mlocati/ip-lib/src/Address/IPv6.php
parent29395507e52962534ff9be5c06a6fc238f3ad23b (diff)
downloadwebtrees-b4669828ea95f526aca6b57eb56d46911d6b16f0.tar.gz
webtrees-b4669828ea95f526aca6b57eb56d46911d6b16f0.tar.bz2
webtrees-b4669828ea95f526aca6b57eb56d46911d6b16f0.zip
Update vendor code
Diffstat (limited to 'vendor/mlocati/ip-lib/src/Address/IPv6.php')
-rw-r--r--vendor/mlocati/ip-lib/src/Address/IPv6.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/vendor/mlocati/ip-lib/src/Address/IPv6.php b/vendor/mlocati/ip-lib/src/Address/IPv6.php
index c133be0af9..36664878b3 100644
--- a/vendor/mlocati/ip-lib/src/Address/IPv6.php
+++ b/vendor/mlocati/ip-lib/src/Address/IPv6.php
@@ -82,6 +82,16 @@ class IPv6 implements AddressInterface
}
/**
+ * {@inheritdoc}
+ *
+ * @see \IPLib\Address\AddressInterface::getNumberOfBits()
+ */
+ public static function getNumberOfBits()
+ {
+ return 128;
+ }
+
+ /**
* Parse a string and returns an IPv6 instance if the string is valid, or null otherwise.
*
* @param string|mixed $address the address to parse
@@ -279,6 +289,21 @@ class IPv6 implements AddressInterface
}
/**
+ * {@inheritdoc}
+ *
+ * @see \IPLib\Address\AddressInterface::getBits()
+ */
+ public function getBits()
+ {
+ $parts = array();
+ foreach ($this->getBytes() as $byte) {
+ $parts[] = sprintf('%08b', $byte);
+ }
+
+ return implode('', $parts);
+ }
+
+ /**
* Get the word list of the IP address.
*
* @return int[]