CHANGELOG for Crypt::Random
           $Id: Changes,v 1.6 2001/07/12 15:59:46 vipul Exp $

1.25 March 07, 2005

1.24 March 07, 2005

1.23 June 02, 2004

1.22 June 01, 2004

1.21 May 24, 2004

1.20 April 21, 2004

       If Size is increased to 4 bits, then of 16 values, there are 5 ways
       to get a 1, 5 ways to get a 2, but 6 ways to get a 0. Thus 0 will
       occur 6/5 = 1.2 times more often than 1 or 2. Increasing size to 6
       bits, there are (2^6-1)/3 ways to get a 1 or 2, but there are
       (2^6+2)/3 ways to get a 0, and a 0 will occur more often by a
       factor of (2^6+2)/(2^6-1).

       If Size is then bumped up to 40, as makerandom_itv does, then 0
       will still happen more often than 1 or 2, but now it happens only
       (2^40+2)/(2^40-1) times more often, or about 1 + 2.7*10^-12 times
       more often. This difference is too small to observe in a practical
       experiment, but it is still a deviation from uniformity.

       What's going on is that when ($b-$a) does not evenly divide 2^N,
       the outcome ($b-1) is less likely to happen than the outcome $a.
       The case that Size=2, $a=0 and $b=3 illustrates this most clearly.

       This is easy to correct: we simply want to make the largest value
       of makerandom() to be evenly divisible by ($b-$a), by ignoring any
       result which is >= (2^Size - (2^Size % ($b-$a))). The second
       attached file includes the fix, which you will see produces uniform
       probabilities if you perform the test given above.

1.13                                                        March 11, 2003

1.12 January, 2003

1.11 July 12, 2001

1.10 July 09, 2001

1.08 June 22, 2001

1.07 June 21, 2001

1.05 June 21, 2001

0.34 April 17, 2001