Converting an IP address to a number:
- by Quandary
Question:
When I convert the IP address 192.168.115.67 to a number, is it done like this:
192*256^3 + 168*256^2+115*256^1+67*256^0 = 3232265027
or like this:
192*256^0 + 168*256^1+115*256^2+67*256^3 = 1131653312
I find both variants online, and frankly it doesn't matter as long as reverse it according to the conversion process.
But I want to calculate the IP V6 from the IPv4 address, and it seems both variants are on the web...
resulting in different IPv6 addresses, and only one can be correct...
I use the 1131653312 variant, as 1131653312 is the variant .NET gives me, but 3232265027 is the variant I find on the web for IPv4 to IPv6 conversion...