Changeset 71


Ignore:
Timestamp:
Sep 23, 2006, 10:37:59 PM (19 years ago)
Author:
dmik
Message:

QCA: Applied somebody's patch (from psi-im.org's Wiki) to fix MSVC 7 build.

Location:
qca/trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • qca/trunk/src/qca.cpp

    r27 r71  
    456456// SHA256
    457457//----------------------------------------------------------------------------
     458
    458459SHA256::SHA256()
    459460:Hash((QCA_HashContext *)getContext(CAP_SHA256))
    460461{
    461462}
     463
    462464
    463465
  • qca/trunk/src/qca.h

    r27 r71  
    5555#endif
    5656
     57
     58
     59
     60
    5761class QHostAddress;
    5862class QStringList;
     
    116120        };
    117121
     122
    118123        template <class T>
    119124        class QCA_EXPORT HashStatic
     
    146151                }
    147152        };
     153
    148154
    149155        class QCA_EXPORT Cipher
     
    187193        };
    188194
    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
    190199        {
    191200        public:
    192201                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)
    195231        class QCA_EXPORT SHA256 : public Hash, public HashStatic<SHA256>
    196232        {
     
    198234                SHA256();
    199235        };
    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
    202242        {
    203243        public:
    204244                MD5();
     245
     246
     247
     248
     249
     250
     251
     252
     253
     254
     255
     256
     257
     258
     259
     260
     261
     262
     263
     264
     265
     266
     267
     268
     269
     270
    205271        };
    206272
Note: See TracChangeset for help on using the changeset viewer.