How do I convert an address like http://3493384340/ to the more familiar IP address format with four unsigned byte values separated by periods?

Tim Rohaly

Internet addresses are actually 32-bit integers - they are only conventionally represented as four unsigned byte values separated by period. This convention makes it easier to remember, parse, and transcribe IP addresses, and facilitates the division of IP networks into subnets.

Translating an address such as 3493384340 requires you to first represent this number in hexadecimal form, i.e. 0xD038D094. Break this 32-bit hexadecimal number into four bytes, stick a period between them, then convert each byte back to decimal. With the above, you would first get D0.38.D0.94, then 208.56.208.148. Thus, http://3493384340/ is equivalent to http://208.56.208.148/. Or, you can reverse the steps to find a single-number representation for your favorite IP address.

0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact