.\" openfwtk project: randomnumber.3 1-Nov-2000 .TH randomnumber 3 .SH NAME randomnumber() \- an arc4 random nuber generator .SH SYNOPSIS .nf #include "fwfunc.h" .fi .sp int \fBrandomnumber\fP() .SH DESCRIPTION The \fIrandomnumber\fP function uses the key stream generator employed by the arc4 cipher, which uses 8*8 8 bit S-Boxes. The S-Boxes can be in about (2**1700) states. When called first time, the function initializes itself using system-dependant noise driver (\fI/dev/random\fP, \fI/dev/urandom\fP or other as specified when compiled). .SH RETURN VALUES The \fIrandomnumber\fP function returns long (converted from u_int32_t) random number .SH SEE ALSO arc4random(3),random(9),random(4) .SH BUGS The function depends on quality of your hardware entropy collector. .PP If your 'long' is longer than 4 bytes, only u_int_32t range will be used for return values. .SH HISTORY A weak PRNG (using time and pid for initial state) is used to be here since fwtk 2.