![]() The seed data takes the form of one or more 32-bit words. The most common way of generating new values is to call the generate(), generate64() or fillRange() functions. ![]() The class can generate 32-bit or 64-bit quantities, or fill an array of those. On Unix systems, it's equivalent to reading from /dev/urandom or the getrandom() or getentropy() system calls. QRandomGenerator::system() may be used to access the system's cryptographically-safe random generator. This object is thread-safe, may be shared for most uses, and is always seeded from QRandomGenerator::system() Additionally, QRandomGenerator::global() returns a global instance of QRandomGenerator that Qt will ensure to be securely seeded. QRandomGenerator::securelySeeded() can be used to create a QRandomGenerator that is securely seeded with QRandomGenerator::system(), meaning that the sequence of numbers it generates cannot be easily predicted. But given different seeds, the results should be considerably different. That is to say, given the same seed data, QRandomGenerator will generate the same sequence of numbers. When seeded, the sequence of numbers generated by this class is deterministic. ![]() Like the C++ random engines, QRandomGenerator can be seeded with user-provided values through the constructor. QRandomGenerator may be used to generate random values from a high-quality random number generator.
0 Comments
Leave a Reply. |