This repository has been archived on 2021-06-27. You can view files and clone it, but cannot push or open issues or pull requests.
modetw/src/md5_wrapper.cpp

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) {}