18 lines
399 B
C++
18 lines
399 B
C++
#include <openssl/md5.h> /* md5sum */
|
|
|
|
#include "../include/md5_wrapper.hpp"
|
|
|
|
MD5_wrapper::MD5_wrapper(unsigned char *md5)
|
|
{
|
|
static const char digits[] = "0123456789abcdef";
|
|
|
|
for (unsigned int i = 0; i < MD5_DIGEST_LENGTH; i++)
|
|
{
|
|
_md5 += digits[md5[i] / MD5_DIGEST_LENGTH];
|
|
_md5 += digits[md5[i] % MD5_DIGEST_LENGTH];
|
|
}
|
|
}
|
|
|
|
MD5_wrapper::MD5_wrapper(const std::string &s)
|
|
: _md5(s) {}
|