Calculates 16-bit cyclic redundancy code (CITT CRC 16).

Applies the standard CITT CRC 16 polynomial to a single byte. It should support being called first with an initial value, then repeatedly until all data is processed.

  • Parameters

    • newByte: number

      The new byte to be run through CRC.

    • prevResult: number

      The previous CRC result.

    Returns number

    The new CRC result.