diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2011-02-25 18:59:29 +0100 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2011-02-25 18:59:29 +0100 |
commit | 7ac56f8ffd5544c6c1f681f79cafbf72d37d0b82 (patch) | |
tree | b14e5e4c1a03be5ac2bd22e41ee74e3634e71923 /apt-pkg/contrib/sha1.h | |
parent | 84a0890e6ef49b5d41a0b9ff0b5a5fe95cca6f3e (diff) | |
download | apt-7ac56f8ffd5544c6c1f681f79cafbf72d37d0b82.tar.gz |
template based hashsum implementation
Diffstat (limited to 'apt-pkg/contrib/sha1.h')
-rw-r--r-- | apt-pkg/contrib/sha1.h | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/apt-pkg/contrib/sha1.h b/apt-pkg/contrib/sha1.h index 8ddd889f1..e7683fa7b 100644 --- a/apt-pkg/contrib/sha1.h +++ b/apt-pkg/contrib/sha1.h @@ -21,28 +21,11 @@ using std::string; using std::min; -class SHA1Summation; +#include "hashsum_template.h" -class SHA1SumValue -{ - friend class SHA1Summation; - unsigned char Sum[20]; - - public: - - // 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 { |