From 7ac56f8ffd5544c6c1f681f79cafbf72d37d0b82 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 25 Feb 2011 18:59:29 +0100 Subject: template based hashsum implementation --- apt-pkg/contrib/md5.h | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) (limited to 'apt-pkg/contrib/md5.h') diff --git a/apt-pkg/contrib/md5.h b/apt-pkg/contrib/md5.h index 96c8975b4..9cc88cfbe 100644 --- a/apt-pkg/contrib/md5.h +++ b/apt-pkg/contrib/md5.h @@ -32,28 +32,11 @@ 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 { -- cgit v1.2.3