#pragma once #include #include #include #include namespace eterpack { // Standard Metin2 / IEEE 802.3 CRC32 (polynomial 0xEDB88320) uint32_t GetCRC32(const char* buf, size_t len); uint32_t GetCaseCRC32(const char* buf, size_t len); inline uint32_t GetCRC32(std::string_view str) { return GetCRC32(str.data(), str.size()); } inline uint32_t GetCaseCRC32(std::string_view str) { return GetCaseCRC32(str.data(), str.size()); } inline uint32_t GetCRC32(std::span data) { return GetCRC32(reinterpret_cast(data.data()), data.size()); } } // namespace eterpack