Re:This is a valid ipv4 address
by sebcioz on Sunday October 20, 2013 @01:50PM
(#6580712)
How can I encode any ip address?
[ Parent
| on HN ]
The 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 == 3098282570In python: struct.unpack(">I", struct.pack("BBBB", 184, 172, 10, 74))
Dot to decimal/hex/octal format conversion, and vice versa. You can use online tools like these: