C/C++ API Reference
Loading...
Searching...
No Matches
pw::checksum::Crc32Impl< kChecksumFunction > Class Template Reference

Overview

template<uint32_t(*)(const void *, size_t, uint32_t) kChecksumFunction>
class pw::checksum::Crc32Impl< kChecksumFunction >

Calculates the CRC32 for all data passed to Update.

This class is more efficient than the CRC32 C functions since it doesn't finalize the value each time it is appended to.

Public Member Functions

void Update (span< const std::byte > data)
 Updates the CRC with the provided data.
 
void Update (std::byte data)
 Updates the CRC with the provided byte.
 
uint32_t value () const
 Returns the value of the CRC32 for all data passed to Update.
 
void clear ()
 Resets the CRC to the initial value.
 

Static Public Member Functions

static uint32_t Calculate (span< const std::byte > data)
 Calculates the CRC32 for the provided data and returns it as a uint32_t.
 

Member Function Documentation

◆ Calculate()

template<uint32_t(*)(const void *, size_t, uint32_t) kChecksumFunction>
static uint32_t pw::checksum::Crc32Impl< kChecksumFunction >::Calculate ( span< const std::byte >  data)
inlinestatic

Calculates the CRC32 for the provided data and returns it as a uint32_t.

To update a CRC in multiple pieces, use an instance of the Crc32 class.


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