From 96e0ecf005846ee4a5d1a92d06026c38d6edae64 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Fri, 19 May 2023 01:18:04 +0300 Subject: [PATCH] remove redundant bits in qRandomUuid() function at first I was thinking about making it compliant with the RFC but then I figured none of the use-cases require it to be compliant (e.g. partitionmanager and the tools that use the generated UUID) Signed-off-by: Ivailo Monev --- src/core/tools/qbytearray.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/core/tools/qbytearray.cpp b/src/core/tools/qbytearray.cpp index a6cc25073..5a874fbb7 100644 --- a/src/core/tools/qbytearray.cpp +++ b/src/core/tools/qbytearray.cpp @@ -242,8 +242,7 @@ quint32 qChecksum(const char *data, uint len) /*! \relates QByteArray - Returns pseudo-randomly generated UUID in DCE variant as - described in \l{https://www.ietf.org/rfc/rfc4122.txt}. + Returns pseudo-randomly generated UUID. */ QByteArray qRandomUuid() { @@ -255,8 +254,6 @@ QByteArray qRandomUuid() *randombufiter = qrand(); randombufiter += randiterratio; } - randombuf[6] = (randombuf[6] & 0x0FFF) | 0x4000; // random version - randombuf[8] = (randombuf[8] & 0x3F) | 0x80; // DCE variant #define UUID_TOHEX(bufi, randi) \ uuidbuf[bufi] = tohex[(randombuf[randi] >> 4) & 0xf]; \