httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Jagielski <...@jaguNET.com>
Subject Re: [PATCH] mod_unique_id.c
Date Sat, 16 Aug 1997 22:17:12 GMT
Dean Gaudet wrote:
> 
> I actually need a 16-bit somewhat random integer ... and I figured the low
> end of tv_usec would be good enough.  Other suggestions are welcome ...
> but I don't think drand/random are sufficient unless we also seed the RNG
> with something more random than time(0).  The problem I'm trying to work
> around are server restarts in the same one second interval... or clocks
> that have gone backwards... but the latter is admittedly not a huge
> concern.
> 

Hmmm... times() returns clock_t which is usually 32bit. Maybe the
lower 16bits of that? Most implementations of of gettimeofday()
just call times() anyway, so times() _might_ be a safer
alternative.
-- 
====================================================================
      Jim Jagielski            |       jaguNET Access Services
     jim@jaguNET.com           |       http://www.jaguNET.com/
            "Look at me! I'm wearing a cardboard belt!"

Mime
View raw message