Core: Add constexpr CRC32 function

This commit is contained in:
Jérôme Leclercq
2022-03-06 19:11:47 +01:00
parent 53157875b9
commit 505d996c88
3 changed files with 97 additions and 0 deletions

View File

@@ -45,6 +45,12 @@ TEST_CASE("ComputeHash", "[CORE][ALGORITHM]")
const char* expectedOutput;
};
static_assert(Nz::CRC32("Nazara Engine") == 0x8A2F5235);
static_assert(Nz::CRC32("The quick brown fox jumps over the lazy dog") == 0x414FA339);
CHECK(Nz::CRC32("Nazara Engine") == 0x8A2F5235);
CHECK(Nz::CRC32("The quick brown fox jumps over the lazy dog") == 0x414FA339);
// https://defuse.ca/checksums.htm
// https://toolslick.com/programming/hashing/crc-calculator