From 79de3008ebfc6b4a5dd32e9de1d19788da0b885d Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 7 Jan 2020 20:36:53 +0100 Subject: 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. --- apt-private/private-show.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'apt-private') diff --git a/apt-private/private-show.cc b/apt-private/private-show.cc index 9ebbe6ac0..103fa57e4 100644 --- a/apt-private/private-show.cc +++ b/apt-private/private-show.cc @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -415,9 +416,9 @@ bool ShowPackage(CommandLine &CmdL) /*{{{*/ static std::string Sha1FromString(std::string const &input) /*{{{*/ { // XXX: move to hashes.h: HashString::FromString() ? - SHA1Summation sha1; + Hashes sha1(Hashes::SHA1SUM); sha1.Add(input.c_str(), input.length()); - return sha1.Result().Value(); + return sha1.GetHashString(Hashes::SHA1SUM).HashValue(); } /*}}}*/ bool ShowSrcPackage(CommandLine &CmdL) /*{{{*/ -- cgit v1.2.3