Webmaster  |  Imprint 
C++ Server Pages
Main  |  License  |  Documentation  |  Download 

md5sum.cpp

Example: md5sum.cpp application


#include <fstream>
#include <iostream>
#include <cxxtools/md5stream.h>

int main(int argc, char* argv[])
{
  cxxtools::Md5stream s;
  for (int i = 1; i < argc; ++i)
  {
    std::ifstream in(argv[i]);
    if (in)
    {
      // copy file to md5stream:
      s << in.rdbuf();
      std::cout << s.getHexDigest() << "  " << argv[i] << std::endl;
    }
  }
}

Copyright © 2008 The Tntnet Development Team
Tntnet 1.6