• gene random

    From remy@21:1/5 to All on Fri Mar 15 16:29:46 2019
    hello

    I took a project view recently
    I propose you my random number generator

    import java.util.*;
    import java.lang.*;
    import java.math.*;
    import java.io.*;

    public class gene
    {
    static FileOutputStream file;
    public static void main(String args[])
    {
    BigInteger p1,p2;
    String p,t;
    Random rnd = new Random();
    try {file=new FileOutputStream ("sortie08.bin");
    } catch (FileNotFoundException e){System.out.println(e);}

    while(true)
    {
    p1 = BigInteger.probablePrime(1024, rnd);
    p2 = BigInteger.probablePrime(512, rnd);
    p=(p1.mod(p2)).toString(2);
    t=(p.substring(p.length()-11,p.length()-3));
    byte monInt = (byte)Integer.parseInt(t,2);

    System.out.println(t+" "+monInt);
    try {file.write(monInt);
    } catch (IOException e){
    System.out.println(e);
    }


    }
    }
    }

    of course the mask can be synchronized or reproducible
    this possibility is not code in the example
    to simplify code reading


    while{
    ....
    n ++
    if (n <512) n = 20
    while (p! = prime) {p = p + 2 ^ n}
    }

    the output test are good, see very good

    http://www.fourmilab.ch/random/

    cdl remy

    --
    http://remyaumeunier.chez-alice.fr/
    toujours autant dyslexique

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)