Closed rohanpurohit closed 3 years ago
@ethanjli This PR is ready for review.
As discussed in our meeting: the naming of read_ntoh
is kind of confusing. The naming will be clearer (and consistent with how Python structs require us to specify whether a field is bigend or littleend rather than network order or host order) if we do something like:
read_bigend(const uint8_t *big_endian, uint16_t &result):
result = set_byte<0, uint16_t>(network_endian[1]) + set_byte<1, uint16_t>(network_endian[0])
This PR proposes switching to read_ntoh instead of parse_network_order: since the implementation of parse_network_order could have lead to a buffer overflow if the correct size wasn't passed