class Digest::CRC16Genibus

Implements the CRC16 Genibus algorithm.

@since 0.5.0

Constants

INIT_CRC
INIT_XOR
TABLE

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

XOR_MASK

Public Instance Methods

update(data) click to toggle source

Updates the CRC16 Genibus checksum.

@param [String] data

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

  return self
end