"Fossies" - the Fresh Open Source Software Archive

Member "scanssh-2.1/arc4random.c" (31 Mar 2004, 373 Bytes) of package /linux/privat/old/scanssh-2.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #include <sys/types.h>
    2 #include <stdlib.h>
    3 
    4 #include "config.h"
    5 
    6 /*
    7  * For those poor operating systems, that do not have a PRNG in their
    8  * libc.  We do not require cryptographic random numbers for this
    9  * application anyway.  Screw you, hippy!
   10  */
   11 
   12 u_int32_t
   13 arc4random(void)
   14 {
   15     static int init;
   16 
   17     if (!init) {
   18         init = 1;
   19         srandom(time(NULL));
   20     }
   21     return (random());
   22 }