8 ms·
How can I encode any ip address?
by sebcioz 13y ago
How can I encode any ip address?
- tzury 13y agoGoogle for "ip to long"...
- tyilo 13y agoThe normal way of displaying the ip address for HN is `184.172.10.74`. You then just have to take each 4 parts and multiply it with a power of 256: 184 * 256^3 + 172 * 256^2 + 10 * 256^1 + 74 * 256^0 == 3098282570
- madmo 13y agoIn python: struct.unpack(">I", struct.pack("BBBB", 184, 172, 10, 74))
- swatkat 13y agoDot to decimal/hex/octal format conversion, and vice versa. You can use online tools like these: http://www.kloth.net/services/iplocate.php http://www.kloth.net/services/iplocate.php