4#include "../Foundation/Compiler.h"
5#ifndef SC_EXPORT_LIBRARY_HASHING
6#define SC_EXPORT_LIBRARY_HASHING 0
8#define SC_HASHING_EXPORT SC_COMPILER_LIBRARY_EXPORT(SC_EXPORT_LIBRARY_HASHING)
10#include "../Foundation/Span.h"
33 static constexpr auto MD5_DIGEST_LENGTH = 16;
34 static constexpr auto SHA1_DIGEST_LENGTH = 20;
35 static constexpr auto SHA256_DIGEST_LENGTH = 32;
78#elif SC_PLATFORM_WINDOWS
82#elif SC_PLATFORM_LINUX
unsigned char uint8_t
Platform independent (1) byte unsigned int.
Definition PrimitiveTypes.h:27
unsigned long long uint64_t
Platform independent (8) bytes unsigned int.
Definition PrimitiveTypes.h:33
Compute MD5, SHA1 or SHA256 hash for stream of data.
Definition Hashing.h:30
Hashing()
Initializes an Hashing struct.
bool add(Span< const uint8_t > data)
Add data to be hashed.
~Hashing()
Destroys an Hashing struct.
bool setType(Type newType)
Set type of hash to compute.
Type
Definition Hashing.h:43
@ TypeMD5
Compute MD5 hash for the incoming stream of bytes.
Definition Hashing.h:44
@ TypeSHA1
Compute SHA1 hash for the incoming stream of bytes.
Definition Hashing.h:45
@ TypeSHA256
Compute SHA256 hash for the incoming stream of bytes.
Definition Hashing.h:46
bool getHash(Result &res)
Finalize hash computation that has been pushed through Hashing::add.
View over a contiguous sequence of items (pointer + size in elements).
Definition Span.h:29