class Digest::CRC16CCITT

Implements the CRC16 CCITT algorithm.

Constants

INIT_CRC
TABLE

Generated by `./pycrc.py –algorithm=table-driven –model=ccitt –generate=c`

Public Instance Methods

update(data) click to toggle source

Updates the CRC16 CCITT checksum.

@param [String] data

The data to update the checksum with.
# File lib/digest/crc16_ccitt.rb, line 53
def update(data)
  data.each_byte do |b|
    @crc = ((@table[((@crc >> 8) ^ b) & 0xff] ^ (@crc << 8)) & 0xffff)
  end

  return self
end