As far as I am aware KuNgFo0 has never been a member; I think there is a link to his website on the main egghelp.org page (which does not indicate affiliation with these forums).crappuccino wrote:it's a dude called KuNgFo0, i thought he would be somehow related to this forum as he is mentioned at the main page
Doesn't look like there is a way to limit the number of bites returned by /dev/randomRANDOM(4) Linux Programmer's Manual RANDOM(4)
NAME
random, urandom - kernel random number source devices
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 such as one-time pad or key generation. When the entropy pool is empty, reads to /dev/random will block until additional environmental noise is gathered.
When read, /dev/urandom device will return as many bytes as are requested.
Code: Select all
#antiwordwrapline###################################################################################################################
foreach f {/dev/random} {
if {[file exists $f]} { set file $f }
}
if {![info exists file]} {
error "Could not find a suitable random file"
} elseif {[catch {open $file r} fileid]} {
error "Could not open random file '$file'"
} elseif {![catch {fconfigure $fileid -buffersize 10} error] && ![binary scan [read $fileid 4] i rand]} {
close $fileid ; error "Random file '$file' gave weird input"
} else {
putcmdlog "[fconfigure $fileid]"
putcmdlog "using file $fileid"
putcmdlog "rand $rand"
close $fileid
return [expr {($rand & $maxint - 1) / double($maxint)}]
}