summaryrefslogtreecommitdiff
path: root/ftparchive/writer.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2020-01-07 20:36:53 +0100
committerJulian Andres Klode <julian.klode@canonical.com>2020-01-14 13:10:36 +0100
commit79de3008ebfc6b4a5dd32e9de1d19788da0b885d (patch)
tree277129f384746a11c25a08d1b0b879c41fe207ad /ftparchive/writer.cc
parentb350560e34a369ef7610f9fceeffb00660209390 (diff)
Convert users of {MD5,SHA1,SHA256,SHA512}Summation to use Hashes
This makes use of the a function GetHashString() that returns the specific hash string. We also need to implement another overload of Add() for signed chars with sizes, so the existing users do not require reinterpret_cast everywhere.
Diffstat (limited to 'ftparchive/writer.cc')
-rw-r--r--ftparchive/writer.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/ftparchive/writer.cc b/ftparchive/writer.cc
index 078638c41..edf548f3a 100644
--- a/ftparchive/writer.cc
+++ b/ftparchive/writer.cc
@@ -493,9 +493,9 @@ bool PackagesWriter::DoPackage(string FileName)
string DescriptionMd5;
if (LongDescription == false) {
- MD5Summation descmd5;
+ Hashes descmd5(Hashes::MD5SUM);
descmd5.Add(desc.c_str());
- DescriptionMd5 = descmd5.Result().Value();
+ DescriptionMd5 = descmd5.GetHashString(Hashes::MD5SUM).HashValue();
Changes.push_back(pkgTagSection::Tag::Rewrite("Description-md5", DescriptionMd5));
if (TransWriter != NULL)
TransWriter->DoPackage(Package, desc, DescriptionMd5);