SourcePP
Several modern C++20 libraries for sanely parsing Valve's formats.
Loading...
Searching...
No Matches
MD5.cpp
Go to the documentation of this file.
1
#include <
sourcepp/crypto/MD5.h
>
2
3
#include <tomcrypt.h>
4
5
#include <
sourcepp/crypto/Globals.h
>
6
7
using namespace
sourcepp
;
8
9
std::array<std::byte, 16>
crypto::computeMD5
(std::span<const std::byte> buffer) {
10
if
(!
LTM_MATH
|| buffer.empty()) {
11
return
{};
12
}
13
14
hash_state md5;
15
md5_init(&md5);
16
md5_process(&md5,
reinterpret_cast<
const
unsigned
char
*
>
(buffer.data()), buffer.size());
17
18
std::array<std::byte, 16>
final
{};
19
md5_done(&md5,
reinterpret_cast<
unsigned
char
*
>
(
final
.data()));
20
return
final
;
21
}
Globals.h
MD5.h
sourcepp::crypto::computeMD5
std::array< std::byte, 16 > computeMD5(std::span< const std::byte > buffer)
Definition
MD5.cpp:9
sourcepp::crypto::LTM_MATH
const bool LTM_MATH
Definition
Globals.cpp:7
sourcepp
Definition
LZMA.h:11
src
sourcepp
crypto
MD5.cpp
Generated on
for SourcePP by
1.16.1