Given a "string filename", how can I get the Adler32 checksum using the C++ Crypto++ library. I am a little confused about using their FileSource and Sink system. Below I have the skeleton of the code that does MD5, but I can't seem to find any examples or tutorials on the Adler32 usage.
string filename = "/tmp/data.txt"
string file_adler32_digest;
string file_md5_digest;
MD5 hashMD5;
FileSource( filename.c_str(),
true,
new HashFilter( hashMD5,
new HexEncoder( new StringSink( file_md5_digest ) ) ) );
/* Confusion begins here */
//how do I do the adler32 ?
/* Confusion ends here */
cout << file_adler32_digest << endl
<< file_md5_digest << endl;
Good samples and sample code here http://www.cryptopp.com/wiki/Category:Sample for all the Crypto++ (except for the Adler32 stuff I want)