I know about QUuid, but i also keno that it is not cryptographic-quality random number generator.
I know about QUuid, but i also keno that it is not cryptographic-quality random number generator.
And how is WinId better than a GUID?
If you want to use "cryptographic-quality random number generator" then take a look at libgcrypt at http://www.gnupg.org/
No, no, I really don't think that WinId is better then QUuid. It was just an exampleAbout GnuPG, thanks, I forget about it.
Just generate a large random number and test it for being prime. You don't need Qt for that.
I know it is a bit late, but...
If it is just about a random number, Linux has a two very nice devices which provide you with entropy based rand numbers. Check the man page (man urandom). If it is about random uuids, read the (publicly readable) file /proc/sys/kernel/random/uuid. This file creates on every read access a new random uuid.
Cheers,
Thomas
There are 10 people in the world. Those who understand binary and those who don't.
I just read the original question again. You are using RC4, so your large number doesn't even have to be prime. If you want a custom random number generator, you can find some in "Numerical Recipes in C".
There are 10 people in the world. Those who understand binary and those who don't.
Who said you should take the code? The algorithm is what is important, the code can be written from scratch. Once you get a grip of how random number generators work (that they are shift registers with feedback), you can design (and implement) your own.
Bookmarks