15typedef unsigned __int8 uint8_t;
16typedef unsigned __int32 uint32_t;
17typedef unsigned __int64 uint64_t;
41 enum { BlockSize = 512 / 8, HashBytes = 16 };
47 std::string
operator()(
const void* data,
size_t numBytes);
49 std::string
operator()(
const std::string& text);
52 void add(
const void* data,
size_t numBytes);
57 void getHash(
unsigned char buffer[HashBytes]);
64 void processBlock(
const void* data);
73 uint8_t m_buffer[BlockSize];
75 enum { HashValues = HashBytes / 4 };
77 uint32_t m_hash[HashValues];
compute MD5 hash
Definition: md5.h:38
void getHash(unsigned char buffer[HashBytes])
return latest hash as bytes
std::string operator()(const void *data, size_t numBytes)
compute MD5 of a memory block
Definition: md5.cpp:370
std::string getHash()
return latest hash as 32 hex characters
Definition: md5.cpp:324
void reset()
restart
Definition: md5.cpp:26
void add(const void *data, size_t numBytes)
add arbitrary number of bytes
Definition: md5.cpp:214
MD5()
same as reset()
Definition: md5.cpp:19