class Digest::CRC16XModem
Implements the CRC16 XMmodem algorithm.
Constants
- TABLE
Generated by `./pycrc.py –algorithm=table-driven –model=xmodem –generate=c`
Public Instance Methods
update(data)
click to toggle source
Updates the CRC16 XModem checksum.
@param [String] data
The data to update the checksum with.
# File lib/digest/crc16_xmodem.rb, line 51 def update(data) data.each_byte do |b| @crc = ((@table[((@crc >> 8) ^ b) & 0xff] ^ (@crc << 8)) & 0xffff) end return self end