IP Address to Integer Conversion in C# (and other languages)
A couple of times, I’ve needed a function to convert a string representation of an IP address to a 32-bit unsigned integer, to save in a database for example. It’s kind of a waste to save the string representation of an IP address in a database, as IPv4 addresses are only 32 bits and fit nicely in a 32-bit unsigned integer field of, for example, a MySQL table. Each character in the string would be a byte! »Click to continue reading…
Popularity: 73%