openMSX
Public Member Functions | List of all members
openmsx::CRC16 Class Reference

This class calculates CRC numbers for the polygon x^16 + x^12 + x^5 + 1. More...

#include <CRC16.hh>

Public Member Functions

constexpr CRC16 (uint16_t initialCRC=0xffff)
 Create CRC16 with an optional initial value. More...
 
constexpr void init (uint16_t initialCRC)
 (Re)initialize the current value More...
 
constexpr void init (std::initializer_list< uint8_t > list)
 
constexpr void update (uint8_t value)
 Update CRC with one byte. More...
 
constexpr void update (const uint8_t *data, size_t size)
 For large blocks (e.g. More...
 
constexpr uint16_t getValue () const
 Get current CRC value. More...
 

Detailed Description

This class calculates CRC numbers for the polygon x^16 + x^12 + x^5 + 1.

Definition at line 37 of file CRC16.hh.

Constructor & Destructor Documentation

◆ CRC16()

constexpr openmsx::CRC16::CRC16 ( uint16_t  initialCRC = 0xffff)
inlineexplicit

Create CRC16 with an optional initial value.

Definition at line 42 of file CRC16.hh.

Member Function Documentation

◆ getValue()

constexpr uint16_t openmsx::CRC16::getValue ( ) const
inline

◆ init() [1/2]

constexpr void openmsx::CRC16::init ( uint16_t  initialCRC)
inline

◆ init() [2/2]

constexpr void openmsx::CRC16::init ( std::initializer_list< uint8_t >  list)
inline

Definition at line 54 of file CRC16.hh.

◆ update() [1/2]

constexpr void openmsx::CRC16::update ( uint8_t  value)
inline

◆ update() [2/2]

constexpr void openmsx::CRC16::update ( const uint8_t *  data,
size_t  size 
)
inline

For large blocks (e.g.

512 bytes) this routine is approx 5x faster than calling the method above in a loop.

Definition at line 73 of file CRC16.hh.

References detail::size().


The documentation for this class was generated from the following files: