Integrated crypto

Robert Connolly cendres at
Thu Apr 1 06:33:32 PST 2004

Anyway. This is an example in

#include <stdlib.h>
 int main(void) {
     int byte1, byte2, byte3;
         byte1 = random() % 256;
         byte2 = random() % 256;
         byte3 = random() % 256;
         printf("#%02x%02x%02x\n", byte1, byte2, byte3);

random() can be replaced with rand() too. The output from this is not random, 
its the same over and over. Why isn't rand() random?

More information about the hlfs-dev mailing list