digest-crc icon indicating copy to clipboard operation
digest-crc copied to clipboard

Fix `Digest::CRC16DNP

Open dearblue opened this issue 2 years ago • 0 comments

  • Set XOR_MASK instead of flipping bits in Digest::CRC16DNP#finish.
  • Digest::CRC16DNP#update does a right bit shift in lib/digest/crc16_dnp.rb. However, the C implementation did a left bit shift. For reference, CRC-16/DNP seems to input bits in reverse order (lower bits). https://reveng.sourceforge.io/crc-catalogue/16.htm#crc.cat.crc-16-dnp

dearblue avatar Jul 07 '23 14:07 dearblue