Exemplo n.º 1
0
        private static long NextShift(Random random, long scale)
        {
            long result = scale;

            while (!AffineHash.Coprime(result, scale))
            {
                result = AffineHash.NextFactor(random, 0L);
            }

            return(result);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AffineHash"/> class.
 /// </summary>
 /// <param name="random">The random number generator that will select a shift factor.</param>
 /// <param name="scale">The scale factor for the hash.</param>
 private AffineHash(Random random, long scale) : this(scale, AffineHash.NextShift(random, scale))
 {
 }
Exemplo n.º 3
0
 public AffineHash(Random random) : this(random, AffineHash.NextScale(random))
 {
 }
Exemplo n.º 4
0
 private static long NextScale(Random random)
 {
     return(AffineHash.NextFactor(random, 1L));
 }