super_random 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/super_random/super_random.rb +10 -3
- data/lib/super_random/version.rb +1 -1
- metadata +4 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03215da020dd9f2ca6c26028f80e3798c3fb422a
|
4
|
+
data.tar.gz: 75510b4c103ae455aaa5dfe8dd43b218d728f391
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 257de2141450a4c98a0cc9f152326ef0b968599b1f9b5c05bbf118ccf562880578a85f14b47208b2d8cedac95546ad24e9344213a201d37ca06ea4b168bc2782
|
7
|
+
data.tar.gz: e2db17df29c0a2dfa45452f841f1da1357c2911a5a4daf2e79e1ac2bfb0868e1074d8e7cf9059ac42d2be086d521656fe703e31ae3d42e24c77e5913dc5c1451
|
@@ -1,5 +1,12 @@
|
|
1
1
|
class SuperRandom
|
2
2
|
|
3
|
+
def self.randbyte(r,n,s)
|
4
|
+
return r.randbyte(n)
|
5
|
+
rescue Exception
|
6
|
+
warn "RealRand's #{s} failed."
|
7
|
+
return nil
|
8
|
+
end
|
9
|
+
|
3
10
|
attr_accessor :first_timeout, :second_timeout, :length, :nevermind, :randomness
|
4
11
|
def initialize
|
5
12
|
@first_timeout = 3
|
@@ -17,9 +24,9 @@ class SuperRandom
|
|
17
24
|
|
18
25
|
a1 = a2 = a3 = nil
|
19
26
|
|
20
|
-
t1 = Thread.new{ a1 =
|
21
|
-
t2 = Thread.new{ a2 =
|
22
|
-
t3 = Thread.new{ a3 =
|
27
|
+
t1 = Thread.new{ a1 = SuperRandom.randbyte(r1,n,'RandomOrg') }
|
28
|
+
t2 = Thread.new{ a2 = SuperRandom.randbyte(r2,n,'EntropyPool') }
|
29
|
+
t3 = Thread.new{ a3 = SuperRandom.randbyte(r3,n,'FourmiLab') }
|
23
30
|
|
24
31
|
begin
|
25
32
|
Timeout.timeout(@first_timeout) do
|
data/lib/super_random/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: super_random
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- carlosjhr64
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: realrand
|
@@ -65,12 +65,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
65
65
|
- !ruby/object:Gem::Version
|
66
66
|
version: '0'
|
67
67
|
requirements:
|
68
|
-
- 'ruby: ruby 2.
|
68
|
+
- 'ruby: ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]'
|
69
69
|
rubyforge_project:
|
70
|
-
rubygems_version: 2.4.1
|
70
|
+
rubygems_version: 2.4.5.1
|
71
71
|
signing_key:
|
72
72
|
specification_version: 4
|
73
73
|
summary: You can't get more random than random, but you can try really, really, really
|
74
74
|
hard.
|
75
75
|
test_files: []
|
76
|
-
has_rdoc:
|