RSB  0.7.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MD5.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of the RSB project.
4  *
5  * Copyright (C) 2011 by Johannes Wienke <jwienke at techfak dot uni-bielefeld dot de>
6  *
7  * Written by Ulrich Drepper <drepper@gnu.ai.mit.edu> and heavily modified
8  * for GnuPG by <werner.koch@guug.de> and adapted for the need of FPM Blowfish
9  * Plugin
10  *
11  * Latest author:
12  * Frederic RUAUDEL <grumz@users.sf.net>
13  * FPMBlowfishPlugin
14  * Copyleft (c) 2003 Frederic RUAUDEL, all rights reversed
15  * Copyleft (C) 1995, 1996, 1998, 1999 Free Software Foundation, Inc.
16  *
17  * This file may be licensed under the terms of the
18  * GNU Lesser General Public License Version 3 (the ``LGPL''),
19  * or (at your option) any later version.
20  *
21  * Software distributed under the License is distributed
22  * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
23  * express or implied. See the LGPL for the specific language
24  * governing rights and limitations.
25  *
26  * You should have received a copy of the LGPL along with this
27  * program. If not, go to http://www.gnu.org/licenses/lgpl.html
28  * or write to the Free Software Foundation, Inc.,
29  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
30  *
31  * The development of this software was supported by:
32  * CoR-Lab, Research Institute for Cognition and Robotics
33  * Bielefeld University
34  *
35  * ============================================================ */
36 
37 #pragma once
38 
39 #include <iostream>
40 #include <string>
41 
42 #include <boost/shared_ptr.hpp>
43 #include <boost/shared_array.hpp>
44 
45 #include "rsb/rsbexports.h"
46 
47 namespace rsb {
48 namespace util {
49 
50 class MD5Hasher;
51 
57 class RSB_EXPORT MD5 {
58 public:
59 
65  MD5(const std::string& s);
66 
67  virtual ~MD5();
68 
75  std::string toHexString(const bool& pretty = false) const;
76 
77 private:
78 
79  boost::shared_ptr<MD5Hasher> hasher;
80  boost::shared_array<unsigned char> hash;
81 
82 };
83 
84 RSB_EXPORT std::ostream& operator<<(std::ostream& stream, const MD5& sum);
85 
86 }
87 }
88