3 ms·
Serialization for non human readable code. Usually IPv4 addresses are stored as int32 in databases or memory
by augusto-moura 6y ago
Serialization for non human readable code. Usually IPv4 addresses are stored as int32 in databases or memory
- morelisp 6y agoPerhaps rather "ideally" than "usually." I have worked on several codebases that wasted gigabytes of memory / traffic on this.
- mordechai9000 6y agoUgh. I would hate to see the code to enumerate a network, or calculate masks, or determine broadcast addresses without using unsigned ints.
- augusto-moura 6y agoI had, unfortunately. Bitwise operations are scary for some people, so they prefer working with 4 ints or worse, using a string
- morelisp 6y ago> 4 ints or worse, using a string Or worse, in one case I've had to deal with both (plus another surprise twist): public class IP { byte[] value // if true value is a variable-length ASCII dotted octet, // if false it is length 4 - with LSB in value[0]. bool isString }