How to convert a hexadecimal value to a "standard" ip address?

خرید بک لینک

Presuming you mean convert it to a string or dotted-notation representation

The first thing you need to know is whether the address is in network byte order, or host byte order. Network byte order is big-endian, whereas intel-based computers are little-endian. You can convert one to the other using a function called ntohl, which basically takes each byte (2 hex characters) from the address, and reverses them, so 80d00297 would become 9702d080

Then you take each byte, and convert to decimal. You can use a calculator for this.

80 => 128
d0 => 208
02 => 2
97 => 151

so, if that address is in host byte order, the address is 128.208.2.151

Recent Questions...

ما را در سایت Recent Questions دنبال می‌کنید

برچسب: نویسنده: استخدام کار بازدید: 242 تاريخ: شنبه 2 مرداد 1395 ساعت: 14:32

صفحه بندی