I asked a question yesterday regarding converting HEX string to IP and got the answer here: C# convert hex into ip
The problem is, when I'm using the function
var ip = new IPAddress(long.Parse(ipString, NumberStyles.AllowHexSpecifier));
it does return a valid IPAddress but does it in a reverse way. For example:
Hex String:
c0a8000a
and it should be parsed to:
192.168.0.10
The long.Parse() function returns
3232235530
But my IP after calling the IPAddress constructor is
10.0.168.192
instead of the right one. Online tools, like http://www.smartconversion.com/unit_conversion/IP_Address_Converter.aspx are working fine. Is it a thing with a little or big endian? Do I have to flip the string myself or is there a simpler answer?