I want to generate a unique sequence of random numbers in QT using QDateTime :: currentDateTime (). toTime_t () as a starting value, qrand () generates unique random numbers?
No. qrandcan only generate as many unique numbers as fit into an integer, so - regardless of implementation - you cannot count on uniqueness.
qrand
Also, knowing that another seed creates another random integer will give you a level of predictability that actually makes it qrandno longer random.
: , , ; , :
alt text http://www.dilbert.com/dyn/str_strip/000000000/00000000/0000000/000000/00000/2000/300/2318/2318.strip.gif
, , ( ) UUID. . QUuid. ( ):
QUuid
createUuid(). UUID, createUuid(), . QUuid::Version QUuid::Random, QUuid::Variant QUuid::DCE. UUID . , UUID, createUuid(), . .
createUuid()
QUuid::Version
QUuid::Random
QUuid::Variant
QUuid::DCE
, UUID , , , , libuuid - .
libuuid
Qt Documentation, QRand - rand(), , / rand() .
I think you need to use a different terminology than "unique" random numbers (no pseudo random number generator will create a unique stream, since input X will always produce output Y). What is the real situation?
Source: https://habr.com/ru/post/1713878/More articles:Special hints for data in jqGrid 3.4 - jqueryRestart a service when an exception is thrown - vb.netRunning a custom view from a custom model. Zend_possible? - zend-frameworkCreating a tag in a new chest in Subversion - version-controlchange the size of the loaded SWF to insert into the canvas - flexHow to calculate one addition using bitwise Ruby operators? - operatorshow can we play audio and video together in ipod / iphone? - iphonehttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1713889/restricting-access-to-images-on-a-website&usg=ALkJrhjLphIlEi18Hy2xMfONUrs7RP8BEwCombinatorics Counting Puzzle: Roll 20, 8-sided dice, what is the probability of getting at least 5 dice of the same value - pythonUse php readfile () or redirect to display image file? - performanceAll Articles