-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMD5Wrapper.h
67 lines (54 loc) · 1.05 KB
/
MD5Wrapper.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
* This is my wrapper-class to create
* a MD5 Hash from a string and a file.
*
* This code is completly free, you
* can copy it, modify it, or do
* what ever you want with it.
*
* Feb. 2005
* Benjamin Grüdelbach
*/
//include protection
#ifndef MD5WRAPPER_H
#define MD5WRAPPER_H
//basic includes
#include <string>
//forwards
class MD5;
class MD5Wrapper {
private:
MD5 * md5;
/*
* internal hash function, calling
* the basic methods from md5.h
*/
std::string hashit(std::string text);
/*
* converts the numeric giets to
* a valid std::string
*/
std::string convToString(unsigned char *bytes);
public:
//constructor
MD5Wrapper();
//destructor
~MD5Wrapper();
/*
* creates a MD5 hash from
* "text" and returns it as
* string
*/
std::string getHashFromString(std::string text);
/*
* creates a MD5 hash from
* a file specified in "filename" and
* returns it as string
*/
std::string getHashFromFile(std::string filename);
};
//include protection
#endif
/*
* EOF
*/