15 #include <zypp-core/base/Logger.h> 16 #include <zypp-core/base/Gettext.h> 17 #include <zypp-core/base/String.h> 19 #include <zypp-core/CheckSum.h> 20 #include <zypp-core/Digest.h> 32 {
static std::string
_type(
"sha" );
return _type; }
128 WAR <<
"Can't determine type of " <<
checksum.size() <<
" byte checksum '" <<
_checksum <<
"'" << endl;
136 std::string msg =
str::form (
_(
"Dubious type '%s' for %u byte checksum '%s'"),
156 if ( input_r.good() && ! type_r.empty() )
160 if ( ! input_r.eof() ||
_checksum.empty() )
178 std::ostringstream
str;
187 return str << std::string(
"NoCheckSum");
190 return str << ( obj.
type().empty() ? std::string(
"UNKNOWN") : obj.
type() ) <<
'-' << obj.
checksum();
195 const std::string & type( obj.
type() );
198 if ( ! type.empty() )
str <<
" type=\"" << type <<
"\"";
212 {
return ! ( lhs == rhs ); }
static const std::string & sha256()
sha256
static const std::string & sha1()
sha1
std::string digest()
get hex string representation of the digest
#define ZYPP_THROW(EXCPT)
Drops a logline and throws the Exception.
static const std::string & sha224Type()
std::ostream & operator<<(std::ostream &str, const InputStream &obj)
std::string asString() const
std::string checksum() const
static const std::string & shaType()
String related utilities and Regular expression matching.
std::string form(const char *format,...) __attribute__((format(printf
Printf style construction of std::string.
static const std::string & sha256Type()
static const std::string & sha512Type()
static const std::string & sha512()
sha512
std::ostream & dumpAsXmlOn(std::ostream &str, const Repository &obj)
std::string toLower(const std::string &s)
Return lowercase version of s.
static const std::string & sha384Type()
static const std::string & md5()
md5
static const std::string & sha1Type()
std::string checksum(const Pathname &file, const std::string &algorithm)
Compute a files checksum.
static const std::string & sha224()
sha224
bool operator!=(const CheckSum &lhs, const CheckSum &rhs)
CheckSum()
Default Ctor: empty checksum.
bool operator==(const CheckSum &lhs, const CheckSum &rhs)
static const std::string & md5Type()
Easy-to use interface to the ZYPP dependency resolver.
static const std::string & sha384()
sha384