23 #ifndef SRECORD_CRC16_H
24 #define SRECORD_CRC16_H
132 unsigned short get()
const;
155 unsigned short state;
169 unsigned short polynomial;
183 unsigned short table[256];
189 void calculate_table(
void);
195 inline unsigned short updcrc(
unsigned char c,
unsigned short state)
const;
The crc16 class is used to represent the running value of a 16-bit cyclic redundancy check of series ...
void print_table(void) const
The print_table method may be used to print the table being used.
void nextbuf(const void *, size_t)
The nextbuf method is used to advance the state by a series of bytes.
unsigned short get() const
The get method is used to obtain the running value of the cyclic redundancy check.
virtual ~crc16()
The destructor.
@ bit_direction_least_to_most
@ bit_direction_most_to_least
crc16(seed_mode_t seed_mode=seed_mode_ccitt, bool augment=true, unsigned short polynomial=polynomial_ccitt, bit_direction_t bitdir=bit_direction_most_to_least)
The default constructor.
crc16 & operator=(const crc16 &)
The assignment operator.
@ polynomial_ccitt
X.25, V.41, HDLC, XMODEM, Bluetooth, SD, CRC-CCITT.
@ polynomial_ansi
CRC-16-IBM, Bisync, Modbus, USB, ANSI X3.28, CRC-16-ANSI.
@ polynomial_dect
CRC-16-DECT.
@ polynomial_dnp
CRC-16-DNP, DNP, IEC 870, M-Bus.
@ polynomial_t10_dif
CRC-16-T10-DIF, SCSI DIF.
static int polynomial_by_name(const char *name)
The polynomial_by_name class method is used to take the name of a CRC-16 polynamlial,...
crc16(const crc16 &)
The copy constructor.
void next(unsigned char)
The next method is used to advance the state by one byte.