#include <md5.h>
Classes | |
struct | HashVal |
Public Types | |
enum | { BlockSize = 512 / 8, HashBytes = 16 } |
split into 64 byte blocks (=> 512 bits), hash is 16 bytes long More... | |
Public Member Functions | |
BE_SQLITE_EXPORT | MD5 () |
same as reset() More... | |
BE_SQLITE_EXPORT Utf8String | operator() (const void *data, size_t numBytes) |
compute MD5 of a memory block More... | |
BE_SQLITE_EXPORT Utf8String | operator() (Utf8StringCR text) |
compute MD5 of a string, excluding final zero More... | |
BE_SQLITE_EXPORT void | Add (const void *data, size_t numBytes) |
add arbitrary number of bytes More... | |
BE_SQLITE_EXPORT Utf8String | GetHashString () |
return latest hash as 32 hex characters More... | |
BE_SQLITE_EXPORT HashVal | GetHashVal () |
return latest hash as bytes More... | |
BE_SQLITE_EXPORT void | Reset () |
restart More... | |
compute MD5 hash
Usage: MD5 md5; std::string myHash = md5("Hello World"); // std::string std::string myHash2 = md5("How are you", 11); // arbitrary data, 11 bytes
or in a streaming fashion:
MD5 md5; while (more data available) md5.add(pointer to fresh data, number of new bytes); std::string myHash3 = md5.getHash();
anonymous enum |
BE_SQLITE_EXPORT MD5 | ( | ) |
same as reset()
BE_SQLITE_EXPORT void Add | ( | const void * | data, |
size_t | numBytes | ||
) |
add arbitrary number of bytes
BE_SQLITE_EXPORT Utf8String GetHashString | ( | ) |
return latest hash as 32 hex characters
BE_SQLITE_EXPORT HashVal GetHashVal | ( | ) |
return latest hash as bytes
BE_SQLITE_EXPORT Utf8String operator() | ( | const void * | data, |
size_t | numBytes | ||
) |
compute MD5 of a memory block
BE_SQLITE_EXPORT Utf8String operator() | ( | Utf8StringCR | text | ) |
compute MD5 of a string, excluding final zero
BE_SQLITE_EXPORT void Reset | ( | ) |
restart