Module etherparse::checksum::u32_16bit_word

source ·
Expand description

Helper functions for calculating a 16 bit checksum using a u32 to sum up all values.

Functions§

  • Add a 2 byte word.
  • Add a 4 byte word.
  • Add the given slice to the checksum. In case the slice has a length that is not multiple of 2 the last byte will be padded with 0.
  • Converts summed up words from an u32 to an u16 which can be used in a ipv4.
  • Converts summed up words from an u32 to an u16 with 0 being replaced by 0xffff (useful for TCP and UDP headers).