4 # Test program for /dev/random
5 # Read and display random numbers.
6 # Try tapping shift/alt/ctrl to get more randomness.
8 # $FreeBSD: src/tools/test/devrandom/hammer.random,v 1.4 1999/08/28 00:54:24 peter Exp $
12 open(BIN
, "/dev/random") || die "Cannot open /dev/random - $!\n";
13 $len = sysread(BIN
, $a, 128);
16 print "$len bytes read: ";
17 for ($j = 0; $j < $len; $j++) {
18 $k = unpack("C", substr($a, $j, 1));