summaryrefslogtreecommitdiffstats
path: root/src/corelib/plugin/quuid.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/plugin/quuid.cpp')
-rw-r--r--src/corelib/plugin/quuid.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/corelib/plugin/quuid.cpp b/src/corelib/plugin/quuid.cpp
index eb29e6e..83c6194 100644
--- a/src/corelib/plugin/quuid.cpp
+++ b/src/corelib/plugin/quuid.cpp
@@ -387,17 +387,17 @@ QUuid::QUuid(const QByteArray &text)
#endif
/*!
- Creates a QUuid object from the binary representation of the UUID, as
- specified by RFC 4122 section 4.1.2. See toRfc4122() for a further
- explanation of the order of bytes required.
+ \since 4.8
- The byte array accepted is NOT a human readable format.
+ Creates a QUuid object from the binary representation of the UUID given
+ by \a bytes, as specified by RFC 4122 section 4.1.2. See toRfc4122() for a
+ further explanation of the order of bytes required.
- If the conversion fails, a null UUID is created.
+ The byte array accepted is \e not a human readable format.
- \since 4.8
+ If the conversion fails, a null UUID is created.
- \sa toRfc4122(), QUuid()
+ \sa toRfc4122(), QUuid()
*/
QUuid QUuid::fromRfc4122(const QByteArray &bytes)
{
@@ -901,6 +901,12 @@ QUuid QUuid::createUuid()
uint randNumber = 0;
for (int filled = 0; filled < intbits; filled += randbits)
randNumber |= qrand()<<filled;
+#if defined(Q_OS_SYMBIAN)
+ // Symbian does not have /dev/urandom, so entropy is low.
+ // Add more entropy from the kernel tick count (1ms resolution).
+ // big multipler used to splatter the tick count bits over the whole 32 bits
+ randNumber ^= User::NTickCount() * 0x3b9aca07;
+#endif
*(data+chunks) = randNumber;
}
}