reading /dev/urandom, /dev/random or /proc/kcore

Steve Kargl sgk@troutmask.apl.washington.edu
Wed Feb 14 18:58:00 GMT 2007


On Wed, Feb 14, 2007 at 10:40:33AM -0800, Steve Kargl wrote:
> On Wed, Feb 14, 2007 at 06:05:32PM +0100, samuel verstraete wrote:
> > Hi list,
> > I would like to be able to read the first few bytes of one of the
> > following binary streams: /dev/urandom, /dev/random or /proc/kcore
> > I then would convert it to integers and use it as a seed for the
> > rand() function.
> > 
> > Is this possible?
> > 
> 
> Yes, see Tobias email.
> 
> I have a possibly dumb question.  If you're going to open
> and read from /dev/urandom or /dev/random, why would you
> want to use the inferior RAND() prng implementation?
> 

Actually, now that I've gone and reviewed the RAND() 
implementation, I'll suggest that you probably want
to use the Fortran 95 RANDOM_NUMBER intrinsic procedure.

-- 
Steve



More information about the Fortran mailing list