59 #ifndef BLOCXX_MD5_HPP_INCLUDE_GUARD_
60 #define BLOCXX_MD5_HPP_INCLUDE_GUARD_
61 #include "blocxx/BLOCXX_config.h"
65 #ifdef BLOCXX_HAVE_STREAMBUF
68 #include <streambuf.h>
70 #ifdef BLOCXX_HAVE_OSTREAM
72 #elif defined(BLOCXX_HAVE_OSTREAM_H)
85 class BLOCXX_COMMON_API MD5StreamBuffer :
public std::streambuf
88 MD5StreamBuffer(MD5* md5);
91 virtual int overflow(
int c);
92 virtual std::streamsize xsputn(
const char* s, std::streamsize num);
95 class BLOCXX_COMMON_API MD5OStreamBase
99 MD5OStreamBase(MD5* md5);
102 class BLOCXX_COMMON_API MD5 :
private MD5OStreamBase,
public std::ostream
112 void init(
const String& input);
118 unsigned char buffer[64];
124 void update(
const String& input);
130 unsigned char* getDigest();
131 static String convertBinToHex(
const unsigned char* sBin);
134 unsigned char m_digest[16];
136 static void MD5Init(
MD5_CTX * md5ctx);
137 static void MD5Update(
MD5_CTX *md5ctx,
const unsigned char* input,
139 static void MD5Final(
unsigned char*,
MD5_CTX *);