// SPDX-FileCopyrightText: Copyright 2026 Gloria Goertz, Mireille Meyer // SPDX-License-Identifier: BSD-2-Clause #include namespace atom { u32 CRC32(std::span bytes, const u32 seed) { u32 crc = seed; for (usize i = 0; i < bytes.size_bytes(); i++) { u32 v = static_cast(crc) ^ bytes.data()[i]; for (u8 k = 0; k < 8; k++) { v = ((v & 1) ? 0 : (u32)0xedb88320L) ^ (v >> 1); } crc = (v ^ (u32)0xff000000L) ^ (crc >> 8); } return crc; } }