29 {
static std::string
_type(
"md5" );
return _type; }
32 {
static std::string
_type(
"sha" );
return _type; }
35 {
static std::string
_type(
"sha1" );
return _type; }
38 {
static std::string
_type(
"sha256" );
return _type; }
46 *
this =
CheckSum( std::string(), checksum );
51 , _checksum( checksum )
53 switch ( checksum.size() )
95 WAR <<
"Can't determine type of " << checksum.size() <<
" byte checksum '" <<
_checksum <<
"'" << endl;
103 std::string msg =
str::form (
_(
"Dubious type '%s' for %u byte checksum '%s'"),
120 if ( input_r.good() && ! type_r.empty() )
124 if ( ! input_r.eof() ||
_checksum.empty() )
142 std::ostringstream str;
151 return str << std::string(
"NoCheckSum");
154 return str << ( obj.
type().empty() ? std::string(
"UNKNOWN") : obj.
type() ) <<
'-' << obj.
checksum();
163 {
return ! ( lhs == rhs ); }