delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/08/01/00:50:52

From: p DOT steiner AT t-online DOT de (Peter Steiner)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Newbie Question: Random Numbers
Date: 28 Jul 1997 22:26:06 GMT
Organization: Telekom Online Internet Gateway
Lines: 34
Message-ID: <5rj69u$pg0$1@news00.btx.dtag.de>
References: <01bc9a61$57701640$204678c7 AT warren1> <33D9FC4E DOT 732C AT cornell DOT edu>
Reply-To: p DOT steiner AT t-online DOT de
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

On Sat, 26 Jul 1997 09:31:58 -0400, A. Sinan Unur <asu1 AT cornell DOT edu> wrote:
>Warren Smith wrote:
>> 
>> How can I get a truly random number (w/o the same sequence of numbers
>> appearing over and over)?
>
>there is _NO_ computer generated truly random number. that is why they
>are called pseudo-random numbers.

The C=64 has a true random generator built into the sound-chip SID ;-)

>do you basically want to seed the random number generator with a
>different seed every time you use it? take a look at the documentation.
>also, search the mail archives at http://www.delorie.com/djgpp/.

Linux has a ´strong random number generator´. They record system-events like
keystrokes or hard-disk access, measure the ´randomness´ of these events and
add this ´randomness´ to an entropy-pool. An entropy-counter is increased by
the amount of randomnes. When you need a random number a MD5-signature of
the entropy-pool is created and the specified amount of ´random´ is
returned. Since you have taken ´randomness´ out of the entropy-pool the
entropy-counter is decreased by the amount you´ve taken. 
This random-generator takes care that you cannot take more random out of the
entropy-pool than is actually inside. As a result you have real strong
random numbers.

Bye,

Peter Steiner
-- 
   _   x    ___
  / \_/_\_ /,--'  p DOT steiner AT t-online DOT de (Peter Steiner)
  \/>'~~~~//
    \_____/   signature V0.2 alpha

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019