super_random 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8807f7235b662b0b31ca33350c880a0d1dcbd25b
4
- data.tar.gz: 81a5e8df8cf7e8c17d31730cb53576c95654838b
3
+ metadata.gz: 03215da020dd9f2ca6c26028f80e3798c3fb422a
4
+ data.tar.gz: 75510b4c103ae455aaa5dfe8dd43b218d728f391
5
5
  SHA512:
6
- metadata.gz: 6fcd936a8a72a6d66b6eccceed32eac37580039037ff25bd75113b32ddeae4eba2719e05eff9af6eb0d467b619a389b3f47bf1cacd4f76266bc0070c048d312d
7
- data.tar.gz: 2ca209d461b7155f6d39517d73b93d988434f16f1249d783bb3cf3524fa980c5346759678c6d492945f08c5eecf27dc6293f68ebdb0d5000e609ade0f6cccbeb
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 = r1.randbyte(n) }
21
- t2 = Thread.new{ a2 = r2.randbyte(n) }
22
- t3 = Thread.new{ a3 = r3.randbyte(n) }
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
@@ -1,3 +1,3 @@
1
1
  class SuperRandom
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
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.2
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: 2014-12-07 00:00:00.000000000 Z
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.1.3p242 (2014-09-19 revision 47630) [x86_64-linux]'
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: