I am not sure why htons
and ntohs
both exist in the standard library. They do exactly the same thing -- unless I'm confused somehow!
The same goes for htonl
and ntohl
.
They make for self-documenting code that tells the reader whether the data is in host- or network- order.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With