]>
Commit | Line | Data |
---|---|---|
58ee6135 RC |
1 | /* |
2 | * Copyright (c) 2001, Robert Collins. | |
3 | * | |
4 | * This program is free software; you can redistribute it and/or modify | |
5 | * it under the terms of the GNU General Public License as published by | |
6 | * the Free Software Foundation; either version 2 of the License, or | |
7 | * (at your option) any later version. | |
8 | * | |
9 | * A copy of the GNU General Public License can be found at | |
10 | * http://www.gnu.org/ | |
11 | * | |
12 | * Written by Robert Collins <rbtcollins@hotmail.com> | |
13 | * | |
14 | */ | |
15 | ||
16 | /* this is the parent class for all package source (not source code - installation | |
17 | * source as in http/ftp/disk file) operations. | |
18 | */ | |
19 | ||
20 | #ifndef _MD5___H_ | |
21 | #define _MD5___H_ | |
22 | ||
23 | /* required to parse this file */ | |
24 | #include "String++.h" | |
25 | ||
26 | // trivial c++ support class for the md5 storage | |
27 | class md5 | |
28 | { | |
29 | public: | |
30 | md5(): _set(false){} | |
31 | bool isSet() const {return _set;} | |
32 | void set(unsigned char const hexdigest[16]){for (int i =0 ;i < 16; ++i)digest[i] = hexdigest[i]; _set = true;} | |
33 | unsigned char const * get() const {return digest;} | |
34 | String print() const; | |
35 | bool operator == (md5 const &rhs)const; | |
36 | bool operator != (md5 const &rhs)const; | |
37 | private: | |
38 | unsigned char digest[16]; | |
39 | bool _set; | |
40 | }; | |
41 | ||
42 | #endif /* _MD5___H_ */ |