Changeset 72
- Timestamp:
- Sep 23, 2006, 10:38:52 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
qca-tls/trunk/qca.h
r34 r72 55 55 #endif 56 56 57 #if defined(_MSC_VER) && _MSC_VER >= 1300 58 #define MSC_NET_HOTFIX 59 #endif 60 57 61 class QHostAddress; 58 62 class QStringList; … … 116 120 }; 117 121 122 #if !defined(MSC_NET_HOTFIX) 118 123 template <class T> 119 124 class QCA_EXPORT HashStatic … … 146 151 } 147 152 }; 153 #endif 148 154 149 155 class QCA_EXPORT Cipher … … 187 193 }; 188 194 189 class QCA_EXPORT SHA1 : public Hash, public HashStatic<SHA1> 195 class QCA_EXPORT SHA1 : public Hash 196 #if !defined(MSC_NET_HOTFIX) 197 , public HashStatic<SHA1> 198 #endif 190 199 { 191 200 public: 192 201 SHA1(); 193 }; 194 202 203 #if defined(MSC_NET_HOTFIX) 204 static QByteArray hash(const QByteArray &a) 205 { 206 SHA1 obj; 207 obj.update(a); 208 return obj.final(); 209 } 210 211 static QByteArray hash(const QCString &cs) 212 { 213 QByteArray a(cs.length()); 214 memcpy(a.data(), cs.data(), a.size()); 215 return hash(a); 216 } 217 218 static QString hashToString(const QByteArray &a) 219 { 220 return arrayToHex(hash(a)); 221 } 222 223 static QString hashToString(const QCString &cs) 224 { 225 return arrayToHex(hash(cs)); 226 } 227 #endif 228 }; 229 230 #if !defined(MSC_NET_HOTFIX) 195 231 class QCA_EXPORT SHA256 : public Hash, public HashStatic<SHA256> 196 232 { … … 198 234 SHA256(); 199 235 }; 200 201 class QCA_EXPORT MD5 : public Hash, public HashStatic<MD5> 236 #endif 237 238 class QCA_EXPORT MD5 : public Hash 239 #if !defined(MSC_NET_HOTFIX) 240 , public HashStatic<MD5> 241 #endif 202 242 { 203 243 public: 204 244 MD5(); 245 246 #if defined(MSC_NET_HOTFIX) 247 static QByteArray hash(const QByteArray &a) 248 { 249 MD5 obj; 250 obj.update(a); 251 return obj.final(); 252 } 253 254 static QByteArray hash(const QCString &cs) 255 { 256 QByteArray a(cs.length()); 257 memcpy(a.data(), cs.data(), a.size()); 258 return hash(a); 259 } 260 261 static QString hashToString(const QByteArray &a) 262 { 263 return arrayToHex(hash(a)); 264 } 265 266 static QString hashToString(const QCString &cs) 267 { 268 return arrayToHex(hash(cs)); 269 } 270 #endif 205 271 }; 206 272
Note:
See TracChangeset
for help on using the changeset viewer.