[Tutor] Re: A question on randomness

Derrick 'dman' Hudson dman@dman.ddts.net
Sat, 13 Jul 2002 00:37:00 -0500


--a+b56+3nqLzpiR9O
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Jul 11, 2002 at 11:22:48PM +0200, Andrea Valle wrote:

| It' a couple of year I work with random generators.

| I know pseudo-random generation is a complex matter. Is there a way to
| "improve" it?

If you don't like python's builtin pseudo-random generator, you can
use the kernel's :

rand =3D open( "/dev/random" , "r" )
data =3D rand.read( 10 ) # just 10 bytes of random data
rand.close()

This works on linux; I don't know about other unices.

-D

--=20
=20
If we confess our sins, He is faithful and just and will forgive us our
sins and purify us from all unrighteousness.
        I John 1:9
=20
http://dman.ddts.net/~dman/


--a+b56+3nqLzpiR9O
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iEYEARECAAYFAj0vvHwACgkQO8l8XBKTpRRC4gCZAQsq3lDZ0o1fh8noJUXqgd1+
+hEAnj+fECntCM0KrXnIGPizjHwIEHS6
=FMxx
-----END PGP SIGNATURE-----

--a+b56+3nqLzpiR9O--