apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Trawick" <traw...@gmail.com>
Subject Re: svn commit: r589911 - in /apr/apr-util/trunk/test: testdate.c testreslist.c
Date Tue, 30 Oct 2007 02:04:18 GMT
On 10/29/07, William A. Rowe, Jr. <wrowe@rowe-clan.net> wrote:
> trawick@apache.org wrote:
> > Author: trawick
> > Date: Mon Oct 29 16:36:09 2007
> > New Revision: 589911
> >
> > URL: http://svn.apache.org/viewvc?rev=589911&view=rev
> > Log:
> > when !APR_HAS_RANDOM, use a lame initial "random" number
> > in test programs instead of bombing with a link failure
>
> > +    guess = apr_time_now() % APR_USEC_PER_SEC;
>
> To make this slightly less lame, would you take this % a number prime to
> 2^32 for some extra flukeishness?  (can hardly call it entropy :)

Some text can be hard to parse (and not knowing what "prime to n"
means doesn't help).  By that do you mean

  guess = apr_time_now() % APR_USEC_PER_SEC % x;

where

gcd(x, 2^32) == 1?

(or just "apr_time_now() % x" which makes more sense, or something
completely different?)

Just type in the desired expression and commit ;)

Mime
View raw message