Mail Archives: djgpp/1997/08/01/00:50:52
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 -