diff options
author | Mike Buland <eichlan@xagasoft.com> | 2009-02-11 05:29:41 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2009-02-11 05:29:41 +0000 |
commit | f4b191f0ea396b58465bfba40749977780a3af58 (patch) | |
tree | 891490e91ab3b67524be67b2b71c85d84fd2f92a /src/old/md5.h | |
parent | 292ae9453e7fdb2f1023ed9dfc99cbcd751f8b90 (diff) | |
download | libbu++-f4b191f0ea396b58465bfba40749977780a3af58.tar.gz libbu++-f4b191f0ea396b58465bfba40749977780a3af58.tar.bz2 libbu++-f4b191f0ea396b58465bfba40749977780a3af58.tar.xz libbu++-f4b191f0ea396b58465bfba40749977780a3af58.zip |
Just removing some things that are cluttering up the source tree.
Diffstat (limited to 'src/old/md5.h')
-rw-r--r-- | src/old/md5.h | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/src/old/md5.h b/src/old/md5.h deleted file mode 100644 index 7f77d83..0000000 --- a/src/old/md5.h +++ /dev/null | |||
@@ -1,81 +0,0 @@ | |||
1 | #ifndef MD5_H | ||
2 | #define MD5_H | ||
3 | |||
4 | /** | ||
5 | * Used to store an MD5 sum in a handy container. | ||
6 | */ | ||
7 | typedef struct | ||
8 | { | ||
9 | /** The actual data-storage for an MD5 sum. */ | ||
10 | long data[4]; | ||
11 | } md5sum; | ||
12 | |||
13 | /** | ||
14 | * Class for easily calculating MD5 sums of just about any data. | ||
15 | *@author Mike Buland | ||
16 | */ | ||
17 | class md5 | ||
18 | { | ||
19 | public: | ||
20 | /** Build an MD5 sum builder. */ | ||
21 | md5(); | ||
22 | |||
23 | /** Deconstruct */ | ||
24 | virtual ~md5(); | ||
25 | |||
26 | /** | ||
27 | * Create a sum of a standard c string, null terminated. This is probably | ||
28 | * the easiest function to use. | ||
29 | *@param pSum The MD5 sum structure to fill up. | ||
30 | *@param sStr The null-terminated string to turn into an MD5 sum. | ||
31 | */ | ||
32 | void sumString( md5sum *pSum, const char *sStr ); | ||
33 | |||
34 | /** | ||
35 | * Create a sum of an array of arbitrary data. This is the most handy for | ||
36 | * dealing with files and so on. | ||
37 | *@param pSum The MD5 sum structure to fill up. | ||
38 | *@param aData A pointer to the base of the data to sum. | ||
39 | *@param nLen The number of bytes to use in the sum. | ||
40 | */ | ||
41 | void sumData( md5sum *pSum, const char *aData, long nLen ); | ||
42 | |||
43 | /** | ||
44 | * Convert an md5sum to standard hex representation. Make sure that sHex | ||
45 | * contains at least 17 characters of space. | ||
46 | *@param pSum The sum structure to convert to hex. | ||
47 | *@param sHex The string to store the hex value in. | ||
48 | */ | ||
49 | void sumToHex( md5sum *pSum, char *sHex ); | ||
50 | |||
51 | private: | ||
52 | /** | ||
53 | * Do the bulk of the work of the md5 algorithm. | ||
54 | *@param x I'm not sure. I'll need to look it up. | ||
55 | *@param len The length of the data. | ||
56 | *@param output The sum structure to put the output in. | ||
57 | */ | ||
58 | void core_md5( long *x, long len, md5sum *output ); | ||
59 | |||
60 | /** | ||
61 | * Convert an array of charaters to an array of longs in a very crafty way. | ||
62 | * This also applies standard MD5 obfuscation to the resulting array, and | ||
63 | * makes it fit within MD5 size constraints. | ||
64 | *@param str The data to convert. | ||
65 | *@param len The length of the data. | ||
66 | *@param nNewLen A pointer to a variable that will hold the new length of | ||
67 | * the resulting array of longs. | ||
68 | *@returns The newly obfuscated and resized long array. | ||
69 | */ | ||
70 | long *c2l( const char *str, long len, long *nNewLen ); | ||
71 | |||
72 | /** | ||
73 | * Backend helper to convert an array of longs into a hex string. | ||
74 | *@param binarray The binary data to convert. | ||
75 | *@param str The string to store the hex string in. | ||
76 | */ | ||
77 | void l2hexstr( long *binarray, char *str ); | ||
78 | |||
79 | }; | ||
80 | |||
81 | #endif | ||