]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/contrib/md5.h
template based hashsum implementation
[apt.git] / apt-pkg / contrib / md5.h
index 96c8975b46f6cc165b257f889bd1bb2f56ac5168..9cc88cfbe6811b7adfc484cb99c260eea712b027 100644 (file)
 using std::string;
 using std::min;
 
-class MD5Summation;
+#include "hashsum_template.h"
 
-class MD5SumValue
-{
-   friend class MD5Summation;
-   unsigned char Sum[4*4];
-   
-   public:
-
-   // Accessors
-   bool operator ==(const MD5SumValue &rhs) const; 
-   string Value() const;
-   inline void Value(unsigned char S[16]) 
-         {for (int I = 0; I != sizeof(Sum); I++) S[I] = Sum[I];};
-   inline operator string() const {return Value();};
-   bool Set(string Str);
-   inline void Set(unsigned char S[16]) 
-         {for (int I = 0; I != sizeof(Sum); I++) Sum[I] = S[I];};
+class MD5Summation;
 
-   MD5SumValue(string Str);
-   MD5SumValue();
-};
+typedef HashSumValue<128> MD5SumValue;
 
 class MD5Summation
 {