[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: OT = just a quicky

On Fri, Feb 01, 2002 at 04:11:51PM +0800, Jason Lim wrote:
> Thanks Damir, Nathan, and David...
> I was doing if=/dev/random (forgot all about /dev/zero), and it was taking
> a very long time to get even near 100M, so I thought there would be a
> better way. Using /dev/zero helped a lot... and I could use tr to change
> them to 1s (created two versions... but I think both would be
> approximately the same speed).

I'm not surprised /dev/random was slow. This is the "true" random number
generator that relys on entropy collected from truely random events like
key-presses, serial interrupts, etc. This means it will stall when it runs
out of entropy. Bashing keys and wiggling your mouse will speed it up, as
this feeds it more entropy.

If you would be content with "almost" random numbers, use /dev/urandom. This
uses /dev/random to seed a random-number generator. This means it is still
pretty random, but it doesn't stall when /dev/random runs out of entropy.

ABO: finger abo@minkirri.apana.org.au for more info, including pgp key

Reply to: