38 #ifndef __BASE_CRC_HH__
39 #define __BASE_CRC_HH__
60 template <u
int32_t Poly>
62 crc32(
const uint8_t*
data, uint32_t crc, std::size_t size)
67 for (
auto i = 0;
i < size;
i++) {
72 for (
auto j = 0;
j <= 7;
j++) {
73 if ((
int)(crc ^
byte) < 0) {
74 crc = (crc << 1) ^ Poly;
uint32_t crc32(const uint8_t *data, uint32_t crc, std::size_t size)
Evaluate the CRC32 of the first size bytes of a data buffer, using a specific polynomium and an initi...
std::enable_if_t< std::is_integral_v< T >, T > reverseBits(T val, size_t size=sizeof(T))
Takes a value and returns the bit reversed version.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....