how would I do this:
Convert this number
3516293025
From dec to a IP address ??
thanks!
Printable View
how would I do this:
Convert this number
3516293025
From dec to a IP address ??
thanks!
huh? Ip addy's are in decimal, there sint a conversion.
You've got Hex, Binary, and Decimal.. there isnt an "IP". Its probably just encrypted or something
or maybe i just dont understand your question
Sorry.. Ill be clearer.
an ip address is a 4x 4byte dec numbers.
10.10.5.3
he took the number and went to bin..
1010101001010011 (10.10.5.3)
then got a 16byte integer
I need to get it back to the 10.10.5.3 =)
Use shift (>>) and bitwise and (&) to split it up into the four bytes, then concatenate them with dots.
You're mistaken about the IP btw. An IP in the xxx.xxx.xxx.xxx representation is 4 1-byte integers, and the number you have is a single 4-byte integer.
You can use modulo and division to get the original number, but bit shifting is faster.