The HyperNews Linux KHG Discussion Pages

Idea: /dev/random

Forum: The Linux Kernel Hackers' Guide
Re: Question Adding code to the Linux Kernel
Date: Sun, 29 Mar 1998 11:20:52 GMT
From: Simon Green <>

Recent kernels (at least 2.0.31 and later) include a device file called /dev/random (no. 1,8). You can read from this device file to get as many random bytes as you need.

Just read in bytes a pair/quad at a time and typecast to int.

This way, you don't need to keep reseeding the generator.