18 #ifndef PSTORE_CORE_CRC32_HPP 19 #define PSTORE_CORE_CRC32_HPP 28 extern std::array<std::uint32_t, 256>
const crc32_tab;
31 template <
typename SpanType>
32 std::uint32_t crc32 (SpanType buf) noexcept {
33 auto * p =
reinterpret_cast<std::uint8_t
const *
> (buf.data ());
34 auto crc = std::uint32_t{0};
35 auto size = buf.size_bytes ();
37 crc = details::crc32_tab[(crc ^ *p++) & 0xFF] ^ (crc >> 8);
43 #endif // PSTORE_CORE_CRC32_HPP
Definition: nonpod2.cpp:40