Austin Schuh | e29400f | 2021-11-19 13:13:31 -0800 | [diff] [blame] | 1 | #ifndef AOS_EVENTS_LOGGING_CRC32_H_ |
| 2 | #define AOS_EVENTS_LOGGING_CRC32_H_ |
| 3 | |
Brian Silverman | d627ed3 | 2021-11-11 16:16:16 -0800 | [diff] [blame] | 4 | #include <stdint.h> |
| 5 | |
| 6 | #include <optional> |
| 7 | |
James Kuszmaul | ef0e0cc | 2021-10-28 23:00:04 -0700 | [diff] [blame] | 8 | #include "absl/types/span.h" |
| 9 | |
| 10 | namespace aos { |
| 11 | |
Austin Schuh | c185afd | 2022-10-16 15:46:24 -0700 | [diff] [blame] | 12 | uint32_t ComputeCrc32(const absl::Span<const uint8_t> data); |
James Kuszmaul | ef0e0cc | 2021-10-28 23:00:04 -0700 | [diff] [blame] | 13 | |
| 14 | uint32_t AccumulateCrc32( |
Austin Schuh | c185afd | 2022-10-16 15:46:24 -0700 | [diff] [blame] | 15 | const absl::Span<const uint8_t> data, |
James Kuszmaul | ef0e0cc | 2021-10-28 23:00:04 -0700 | [diff] [blame] | 16 | std::optional<uint32_t> current_checksum = std::nullopt); |
| 17 | |
| 18 | } // namespace aos |
Austin Schuh | e29400f | 2021-11-19 13:13:31 -0800 | [diff] [blame] | 19 | |
| 20 | #endif // AOS_EVENTS_LOGGING_CRC32_H_ |