Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hex to ip address

Status
Not open for further replies.

adibzo

Technical User
Aug 11, 2003
2
US
Can you please show me how to take a hex value and then display the result as an ip address
ex 2fb36894 --> aaa.bbb.xxx.ddd
thanks
 
Convert to binary and then use a simple algorithm to
split and calculate the address by octet.

 
Another solution with scan:
Code:
  set x 2fb36894
  scan $x %2x%2x%2x%2x x1 x2 x3 x4
  puts $x1.$x2.$x3.$x4
-> 47.179.104.148
HTH

ulis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top