AceCRC  0.1
Cyclic Redundancy Check (CRC) algorithms (e.g. crc32(), crc16ccitt()) are progammatically converted from pycrc to Arduino C++, including variants (e.g. 4-bit versus 8-bit tables) that trade space and time.
crc32_nibble.hpp
Go to the documentation of this file.
1 
44 #ifndef ACE_CRC_CRC32_NIBBLE_HPP
45 #define ACE_CRC_CRC32_NIBBLE_HPP
46 
47 #include <stdlib.h>
48 #include <stdint.h>
49 
50 namespace ace_crc {
51 namespace crc32_nibble {
52 
53 
60 static const uint8_t CRC_ALGO_TABLE_DRIVEN = 1;
61 
62 
68 typedef uint_fast32_t crc_t;
69 
70 
76 static inline crc_t crc_init(void)
77 {
78  return 0xffffffff;
79 }
80 
81 
90 crc_t crc_update(crc_t crc, const void *data, size_t data_len);
91 
92 
99 static inline crc_t crc_finalize(crc_t crc)
100 {
101  return crc ^ 0xffffffff;
102 }
103 
104 
105 } // crc32_nibble
106 } // ace_crc
107 
108 #endif /* ACE_CRC_CRC32_NIBBLE_HPP */
ace_crc::crc32_nibble::crc_t
uint_fast32_t crc_t
The type of the CRC values.
Definition: crc32_nibble.hpp:68