Sujet : Re: lun - Lucky Number
De : rich (at) *nospam* example.invalid (Rich)
Groupes : sci.cryptDate : 08. Mar 2025, 22:47:57
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vqidud$arf3$2@dont-email.me>
References : 1 2 3
User-Agent : tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.139 (x86_64))
Stefan Claas <
fgrsna.pynnf@vagrearg.eh> wrote:
Why do you always have something to "complain" about?
I am sorry you feel that way.
Enjoy the software, it is cool
Not really (in my opinion).
and not so boring like using dev/urandom.
Also, likely not as good a 'randomness' generator either.
Or better instead of "complaining" do something creative, crypto wise
and show it to us too.
Ok, here's a simple random number generator using /dev/urandom:
#!/usr/bin/tclsh
set fd [open /dev/urandom {RDONLY BINARY}]
binary scan [read $fd 16] ww hi lo
close $fd
puts "Your 128-bit random number is: [expr {abs($hi)*2^64 + abs($lo)}]"
Four sample runs:
~$ ./random.tcl
Your 128-bit random number is: 12845925169244013330
~$ ./random.tcl
Your 128-bit random number is: 12267131317558982811
~$ ./random.tcl
Your 128-bit random number is: 10434877321040400260
~$ ./random.tcl
Your 128-bit random number is: 16618556391581443091