SourcePP
Several modern C++20 libraries for sanely parsing Valve's formats.
Loading...
Searching...
No Matches
CRC32.cpp
Go to the documentation of this file.
2
3#include <cryptopp/crc.h>
4
5using namespace sourcepp;
6
7uint32_t crypto::computeCRC32(std::span<const std::byte> buffer) {
8 // Make sure this is right
9 static_assert(CryptoPP::CRC32::DIGESTSIZE == sizeof(uint32_t));
10
11 CryptoPP::CRC32 crc32;
12 crc32.Update(reinterpret_cast<const CryptoPP::byte*>(buffer.data()), buffer.size());
13
14 uint32_t final;
15 crc32.Final(reinterpret_cast<CryptoPP::byte*>(&final));
16 return final;
17}
uint32_t computeCRC32(std::span< const std::byte > buffer)
Definition: CRC32.cpp:7
Definition: LZMA.h:11