X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/42ab8223d52672cf28c6e2e574bb364c438bd49a..f5b622ed48fdbe235d81b61b3edd8dbb84d9cc9c:/apt-pkg/contrib/sha1.h diff --git a/apt-pkg/contrib/sha1.h b/apt-pkg/contrib/sha1.h index db8ca7893..e7683fa7b 100644 --- a/apt-pkg/contrib/sha1.h +++ b/apt-pkg/contrib/sha1.h @@ -14,38 +14,18 @@ #ifndef APTPKG_SHA1_H #define APTPKG_SHA1_H -#ifdef __GNUG__ -#pragma interface "apt-pkg/sha1.h" -#endif - #include +#include #include using std::string; using std::min; -class SHA1Summation; - -class SHA1SumValue -{ - friend class SHA1Summation; - unsigned char Sum[20]; - - public: +#include "hashsum_template.h" - // Accessors - bool operator ==(const SHA1SumValue &rhs) const; - string Value() const; - inline void Value(unsigned char S[20]) - {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[20]) - {for (int I = 0; I != sizeof(Sum); I++) Sum[I] = S[I];}; +class SHA1Summation; - SHA1SumValue(string Str); - SHA1SumValue(); -}; +typedef HashSumValue<160> SHA1SumValue; class SHA1Summation {