CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
cms::MD5Result Struct Reference

#include <Digest.h>

Public Member Functions

std::string compactForm () const
 
void fromHexifiedString (std::string const &s)
 
bool isValid () const
 
 MD5Result ()
 
std::string toString () const
 

Public Attributes

unsigned char bytes [16]
 

Detailed Description

Definition at line 13 of file Digest.h.

Constructor & Destructor Documentation

cms::MD5Result::MD5Result ( )

Definition at line 64 of file Digest.cc.

References cms::set_to_default().

65  {
66  set_to_default(*this);
67  }
void set_to_default(MD5Result &val)
Definition: Digest.cc:44

Member Function Documentation

std::string cms::MD5Result::compactForm ( ) const

Definition at line 102 of file Digest.cc.

References bytes, AlCaHLTBitMon_ParallelJobs::p, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by edm::hash_detail::fixup_(), and edm::detail::InvalidHash().

103  {
104  // This is somewhat dangerous, because the conversion of 'unsigned
105  // char' to 'char' may be undefined if 'char' is a signed type
106  // (4.7p3 in the Standard).
107  const char* p = reinterpret_cast<const char*>(&bytes[0]);
108  return std::string(p, p+sizeof(bytes));
109  }
unsigned char bytes[16]
Definition: Digest.h:21
void cms::MD5Result::fromHexifiedString ( std::string const &  s)

Definition at line 111 of file Digest.cc.

References bytes, Exception, mps_fire::i, edm::errors::LogicError, and cms::set_to_default().

Referenced by edm::hash_detail::fixup_().

112  {
113  switch (hexy.size())
114  {
115  case 0:
116  {
117  set_to_default(*this);
118  }
119  break;
120  case 32:
121  {
122  std::string::const_iterator it = hexy.begin();
123  for (size_t i = 0; i != 16; ++i)
124  {
125  // first nybble
126  bytes[i] = ( unhexify(*it++) << 4 );
127  // second nybble
128  bytes[i] += ( unhexify(*it++) );
129  }
130  }
131  break;
132  default:
133  {
134  // Not really sure of what sort of exception to throw...
136  << "String of illegal length: "
137  << hexy.size()
138  << " given to MD5Result::fromHexifiedString";
139  }
140  }
141  }
unsigned char bytes[16]
Definition: Digest.h:21
void set_to_default(MD5Result &val)
Definition: Digest.cc:44
bool cms::MD5Result::isValid ( void  ) const

Definition at line 143 of file Digest.cc.

Referenced by ntupleDataFormat._Object::_checkIsValid(), and core.AutoHandle.AutoHandle::ReallyLoad().

144  {
145  return (*this != invalidResult());
146  }
std::string cms::MD5Result::toString ( ) const

Member Data Documentation

unsigned char cms::MD5Result::bytes[16]