summaryrefslogtreecommitdiffstats
path: root/src/corelib/plugin/quuid.h
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@nokia.com>2012-01-04 11:15:20 +0100
committerQt by Nokia <qt-info@nokia.com>2012-01-10 05:12:20 +0100
commit8c72dc5907a97fce718f6810d446ecf6ea41b588 (patch)
tree913fcad772e6a7f1dd891a60e5c8937c14f02994 /src/corelib/plugin/quuid.h
parent679c4c002d97c5dcd34af701b3379c2bb03d02a2 (diff)
Add V3(md5) and V5(sha1) version for DCE in QUuid
Add the above versions based on RFC4122 standard. Done-with: Hagen Rother Task-number: QTBUG-23071 Change-Id: Ieb90925374d1e3c85011b899b8dd3bb1a608c561 Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
Diffstat (limited to 'src/corelib/plugin/quuid.h')
-rw-r--r--src/corelib/plugin/quuid.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/corelib/plugin/quuid.h b/src/corelib/plugin/quuid.h
index 2eec1575e5..9efb2ba37c 100644
--- a/src/corelib/plugin/quuid.h
+++ b/src/corelib/plugin/quuid.h
@@ -43,6 +43,7 @@
#define QUUID_H
#include <QtCore/qstring.h>
+#include <QtCore/qcryptographichash.h>
QT_BEGIN_HEADER
@@ -79,8 +80,10 @@ public:
VerUnknown =-1,
Time = 1, // 0 0 0 1
EmbeddedPOSIX = 2, // 0 0 1 0
- Name = 3, // 0 0 1 1
- Random = 4 // 0 1 0 0
+ Md5 = 3, // 0 0 1 1
+ Name = Md5,
+ Random = 4, // 0 1 0 0
+ Sha1 = 5 // 0 1 0 1
};
QUuid()
@@ -173,6 +176,21 @@ public:
}
#endif
static QUuid createUuid();
+ static QUuid createUuidV3(const QUuid &ns, const QByteArray &baseData);
+ static QUuid createUuidV5(const QUuid &ns, const QByteArray &baseData);
+#ifndef QT_NO_QUUID_STRING
+ static inline QUuid createUuidV3(const QUuid &ns, const QString &baseData)
+ {
+ return QUuid::createUuidV3(ns, baseData.toUtf8());
+ }
+
+ static inline QUuid createUuidV5(const QUuid &ns, const QString &baseData)
+ {
+ return QUuid::createUuidV5(ns, baseData.toUtf8());
+ }
+
+#endif
+
QUuid::Variant variant() const;
QUuid::Version version() const;