1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/vlib/net/conv
2023-05-22 06:59:33 +03:00
..
conv_test.v all: replace generic <> with [] - part 2 (#16536) 2022-11-26 18:23:26 +02:00
conv.v net.conv: use a pure v implementation instead of C.hton etc (#18226) 2023-05-22 06:59:33 +03:00
README.md net.conv: use a pure v implementation instead of C.hton etc (#18226) 2023-05-22 06:59:33 +03:00

Description:

net.conv provides a convenient way to convert number values to, and from the network byte order format (which is always big endian).

When communicating across a network, it is possible that the machines use different byte orders, since the host format of each system can vary, depending on the CPU, and on most systems, is usually little endian.

To avoid mismatches due to that, the network byte order is used by convention to send network data in a manner that will be received coherently, regardless of the endianness of the sender system and the receiver system.