[LUGOS-PROG] Bash si sladak
Ales Kosir
ales.kosir at zaslon.com
Thu Mar 21 13:25:41 CET 2002
To, da zadeva deluje pravilneje, ce je vmes sleep, je povezano s tem, da se
na debianu uporablja vgrajeni generator nakljucnih stevil, ki potrebuje
'dovolj entropije' v sistemu, da vrne novo nakljucno stevilo, sicer pa vrne
kar starega. Odgovor je skrit v man 4 random. Poglejte, kako deluje
/dev/random in urandom:
DESCRIPTION
The character special files /dev/random and /dev/urandom
(present since Linux 1.3.30) provide an interface to the
kernel's random number generator. File /dev/random has
major device number 1 and minor device number 8. File
/dev/urandom has major device number 1 and minor device
number 9.
The random number generator gathers environmental noise
from device drivers and other sources into an entropy
pool. The generator also keeps an estimate of the number
of bit of the noise in the entropy pool. From this
entropy pool random numbers are created.
When read, the /dev/random device will only return random
bytes within the estimated number of bits of noise in the
entropy pool. /dev/random should be suitable for uses
that need very high quality randomness...
Problem je, kar se mene tice, analiziran in zakljucen.
Lep pozdrav,
Ales
-----Original Message-----
From: Miha Tomšič [mailto:miha.tomsic at guest.arnes.si]
Sent: Wednesday, March 20, 2002 12:30 PM
To: lugos-prog at lugos.si
Subject: RE: [LUGOS-PROG] Bash si sladak
Hojla!
On Tue, 19 Mar 2002, Ales Kosir wrote:
> Tisti, ki vam random ne vraca nakljucnih stevil, poskusite se tole:
> for ((i=1; i<5 ; i++)); do echo $RANDOM; sleep 1; done | cat
Ja, zadeva deluje pravilneje. Ampak to še ne pojasni nastale napake, poleg
tega pa je izvajanje "dolgočasno".
Miha...
- Miha Tomšič --- C. na postajo 55 -- SI-1351 Brezovica pri Lj. ---
SLOVENIA -
More information about the lugos-prog
mailing list