Random algorithm

Mark Smith lists at futilism.com
Tue Nov 11 21:34:33 EST 2008


Interestingly, on OS X and Linux, you can read from "/dev/random" and  
get crypto-quality random numbers:

       put "/dev/random" into tFile
       open file tFile for binary read
       read from file tFile for 1000 uint4
       put it into tRandNums
       close file tFile

will get you a comma delimited list of 1000 numbers bewteen 0 and 2 ^  
32.

I can't find anything similar on Windows, but maybe one of Ken's  
crafty VB scripts can get at the relevant OS API call "CryptGenRandom".

http://en.wikipedia.org/wiki/Urandom

Best,

Mark



More information about the use-livecode mailing list