Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

Q: What's buried in Grant's tomb? A: A corpse.


sci / sci.crypt.random-numbers / gene random

SubjectAuthor
o gene randomremy

1
Subject: gene random
From: remy
Newsgroups: sci.crypt.random-numbers
Organization: Guest of ProXad - France
Date: Fri, 15 Mar 2019 15:29 UTC
Path: eternal-september.org!news.eternal-september.org!reader01.eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!cleanfeed1-a.proxad.net!nnrp1-1.free.fr!not-for-mail
Newsgroups: sci.crypt.random-numbers
X-Mozilla-News-Host: news://proxad.free.adsl.degroupage:119
From: remy@fctpas.fr (remy)
Subject: gene random
Date: Fri, 15 Mar 2019 16:29:46 +0100
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:52.0) Gecko/20100101
Thunderbird/52.9.1
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: fr
Content-Transfer-Encoding: 7bit
Lines: 61
Message-ID: <5c8bc4e9$0$19261$426a74cc@news.free.fr>
Organization: Guest of ProXad - France
NNTP-Posting-Date: 15 Mar 2019 16:29:45 CET
NNTP-Posting-Host: 178.16.162.106
X-Trace: 1552663785 news-2.free.fr 19261 178.16.162.106:50692
X-Complaints-To: abuse@proxad.net
View all headers

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

1

rocksolid light 0.9.8
clearnet tor