src/Range/Subnet.php 1 location
|
@@ 311-317 (lines=7) @@
|
308 |
|
* |
309 |
|
* @see \IPLib\Range\RangeInterface::getSize() |
310 |
|
*/ |
311 |
|
public function getSize() |
312 |
|
{ |
313 |
|
$fromAddress = $this->fromAddress; |
314 |
|
$maxPrefix = $fromAddress::getNumberOfBits(); |
315 |
|
$prefix = $this->getNetworkPrefix(); |
316 |
|
|
317 |
|
return pow(2, ($maxPrefix - $prefix)); |
318 |
|
} |
319 |
|
} |
320 |
|
|
src/Range/Pattern.php 1 location
|
@@ 276-282 (lines=7) @@
|
273 |
|
* |
274 |
|
* @see \IPLib\Range\RangeInterface::getSize() |
275 |
|
*/ |
276 |
|
public function getSize() |
277 |
|
{ |
278 |
|
$fromAddress = $this->fromAddress; |
279 |
|
$maxPrefix = $fromAddress::getNumberOfBits(); |
280 |
|
$prefix = $this->getNetworkPrefix(); |
281 |
|
|
282 |
|
return pow(2, ($maxPrefix - $prefix)); |
283 |
|
} |
284 |
|
|
285 |
|
/** |