Post
Topic
Board Development & Technical Discussion
Re: Hex value of ip address why reversed?
by
wsxdrfv
on 12/03/2018, 01:56:56 UTC
If my real IP address is 175.126.37.238 and this address should be input above, then 0xee257eaf   is correct? Internet site hex to ip
https://www.browserling.com/tools/hex-to-ip
shows this 0xee257eaf  is 238.37.126.175


This is due to Endianness (https://en.wikipedia.org/wiki/Endianness).

When communicating via a network, you don't know how your counterparty is 'reading' the values.
Most significant bit at the most left or most right position?

Big-endian (most significant byte has the lowest address [left-to-right reading]) is also referred to network byte order.
Depending on the system you are using your pc might use big- or low- endian format. But when communicating via network, always big endian is used (IPv4/6, TCP/UDP).

Thats the reason for the mysterious reverse order.



I don't know Endian well, but perfect description.