- Rename CcittCrc16 and related functions to Crc16Ccitt, which matches
the algorithm's full standard name (CRC-16-CCITT).
- Create classes for calculating the CRC-16-CCITT and CRC-32. Use the
function names, which were nouns, as the class names (Crc16Ccitt and
Crc32) and provide the functions as class static functions
(Crc16Ccitt::Calculate and Crc32::Calculate).
Change-Id: I625ed715935de3f1000d3119c21a2f6d01245173
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/17403
Reviewed-by: Keir Mierle <keir@google.com>
- The CRC32 code fails to build in optimized builds. The inline keyword
differs in meaning between C and C++. Inline C functions need to be
declared static inline to link equivalently to an inline C++ function.
Add static to the inline C function.
- Expand some comments.
Change-Id: I16a12bc0cbb666efbf5c479c6ff6a48d94ca5e1f
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/13840
Reviewed-by: David Rogers <davidrogers@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>