On 1/29/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
The pseudo-random number generator (PRNG) in SQLite is becoming more important so it seem good to make sure it is well seeded.
I'd like to be able to seed the random number generator so I can have repeatable sequences of random numbers (for testing, etc.). The only really random numbers are generated from hardware, and that's problematic. You can't make it cross platform, or even cross processor, without a lot of switches/if statements/etc. Please pick a pseudo algorithm of your choice and give us the ability to seed it? On
Unix this is easy - just open /dev/urandom and read out as much randomness as you need. But I do not know how to do this on win32 and wince. The current implementation seeds the random number generator on these platforms by grabbing a copy of the current system time. See the sqlite3WinRandomSeed() function in os_win.c for details. This is not a very good method for seeding a PRNG. Can someone with more knowledge of win32 and wince please suggest a better method for seeding the PRNG on those platforms? -- D. Richard Hipp <[EMAIL PROTECTED]> ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------
-- -- The PixAddixImage Collector suite: http://groups-beta.google.com/group/pixaddix SqliteImporter and SqliteReplicator: Command line utilities for Sqlite http://www.reddawn.net/~jsprenkl/Sqlite Cthulhu Bucks! http://www.cthulhubucks.com