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.
1
#include <
sourcepp/crypto/CRC32.h
>
2
3
#include <cryptopp/crc.h>
4
5
using namespace
sourcepp
;
6
7
uint32_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
}
CRC32.h
sourcepp::crypto::computeCRC32
uint32_t computeCRC32(std::span< const std::byte > buffer)
Definition:
CRC32.cpp:7
sourcepp
Definition:
LZMA.h:11
src
sourcepp
crypto
CRC32.cpp
Generated by
1.9.6