Getting number of IPv6 addresses from Ipv6 CIDR in PHP
问题 Is there a way to get the number of IPv6 addresses from a Ipv6 CIDR? for example: CIDR: 2403:3E00::/32 => need get number of ipv6 addresses: 79228162514264337593543950336 回答1: An IPv6 address has 128 bits, of which (slightly simplified) a number are dedicated to network address, and the rest are dedicated to host addresses. In your case, 32 bits are dedicated to the network part ( /32 ), so the other 96 are dedicated to host addresses. 2^(128-32) = 2^96 = 79228162514264337593543950336 hosts