da_funk 3.28.2 → 3.29.0

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
  SHA256:
3
- metadata.gz: b4d0d54c5c119b8292581b762890e56ac8236cfaba00da8a7771b7cbd7bb4e86
4
- data.tar.gz: 010a769cea5606eb804a641d1608ee0eb26ee9284d987606b4654fde8a7c4dcf
3
+ metadata.gz: 37d7e3cf03459d285f8f3dc049befefc6857d63f8f9d3920c7a28e5ba128879e
4
+ data.tar.gz: 78e552609442541e0dec9badacbcabe081ef2541350f3b9e5c684d106dd72871
5
5
  SHA512:
6
- metadata.gz: b395196c638fc69b56609d90eb1e460b1db746eca86d641964c7efb38106a154ba303aa4aa49b9e01134ea8658930630516fd7959a657d208f3787674ec145d1
7
- data.tar.gz: c8f3818542777f7b5c2338913a6fe760a6f81532640a6b7e79e712f6ed76297f1c813071b4a5beb987b4c3830e023741ae84844811439e26423bb26e3e08f05c
6
+ metadata.gz: 7e08477af30c8b15a55b9b20d5132d90afb85d17609758bde631f09697cca24527e12069dc7a82b33dc2da3ccde99e62b8a1404cfc113d369be25ab645700f3a
7
+ data.tar.gz: 1bfe9676a867791075006151532f96b02fae0a3b2bf194b1389804b8aac5f29980671709567db2fe6a3de2d7b234a077168764da0db7f5f6f7ee4d9c49e5a1c7
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- da_funk (3.28.2)
4
+ da_funk (3.29.0)
5
5
  archive-zip (~> 0.5)
6
6
  bundler
7
7
  cloudwalk_handshake
@@ -18,7 +18,7 @@ GEM
18
18
  cloudwalk (1.15.0)
19
19
  bundler
20
20
  rake
21
- cloudwalk_handshake (1.20.0)
21
+ cloudwalk_handshake (1.21.3)
22
22
  funky-simplehttp (~> 0.6)
23
23
  funky-emv (1.4.1)
24
24
  funky-tlv (~> 0.2)
@@ -27,25 +27,25 @@ GEM
27
27
  funky-tlv (0.2.3)
28
28
  io-like (0.3.1)
29
29
  parallel (1.19.2)
30
- parser (2.7.1.4)
30
+ parser (2.7.2.0)
31
31
  ast (~> 2.4.1)
32
32
  posxml_parser (2.26.0)
33
33
  funky-emv (~> 1)
34
34
  rainbow (3.0.0)
35
35
  rake (13.0.1)
36
- regexp_parser (1.7.1)
36
+ regexp_parser (1.8.2)
37
37
  rexml (3.2.4)
38
- rubocop (0.90.0)
38
+ rubocop (1.1.0)
39
39
  parallel (~> 1.10)
40
- parser (>= 2.7.1.1)
40
+ parser (>= 2.7.1.5)
41
41
  rainbow (>= 2.2.2, < 4.0)
42
- regexp_parser (>= 1.7)
42
+ regexp_parser (>= 1.8)
43
43
  rexml
44
- rubocop-ast (>= 0.3.0, < 1.0)
44
+ rubocop-ast (>= 1.0.1)
45
45
  ruby-progressbar (~> 1.7)
46
46
  unicode-display_width (>= 1.4.0, < 2.0)
47
- rubocop-ast (0.4.0)
48
- parser (>= 2.7.1.4)
47
+ rubocop-ast (1.1.0)
48
+ parser (>= 2.7.1.5)
49
49
  ruby-progressbar (1.10.1)
50
50
  unicode-display_width (1.7.0)
51
51
  yard (0.9.25)
@@ -1,5 +1,10 @@
1
1
  # DaFunk
2
2
 
3
+ ### 3.29.0 - 2020-11-03
4
+
5
+ - Added support to Ruby SecureRandom;
6
+ - Update cloudwalk_handshake (1.21.3).
7
+
3
8
  ### 3.28.2 - 2020-10-07
4
9
 
5
10
  - Added support of params.dat file restore if it was corrupted;
data/Rakefile CHANGED
@@ -56,6 +56,7 @@ FILES = FileList[
56
56
  "lib/da_funk/notification_event.rb",
57
57
  "lib/da_funk/notification_callback.rb",
58
58
  "lib/da_funk/notification.rb",
59
+ "lib/da_funk/secure_random.rb",
59
60
 
60
61
  "lib/device.rb",
61
62
  "lib/device/audio.rb",
@@ -0,0 +1,17 @@
1
+ module DaFunk
2
+ class SecureRandom
3
+ CHARS = [('a'..'z'), ('A'..'Z')].map(&:to_a).flatten
4
+
5
+ def self.random_bytes(n = nil)
6
+ n = n ? n.to_int : 16
7
+ (0...n).map { CHARS[rand(CHARS.length)] }.join
8
+ end
9
+
10
+ def self.uuid
11
+ bytes = random_bytes.unpack('NnnnnN')
12
+ bytes[2] = (bytes[2] & 0x0fff) | 0x4000
13
+ bytes[3] = (bytes[3] & 0x3fff) | 0x8000
14
+ "%08x-%04x-%04x-%04x-%04x%08x" % bytes
15
+ end
16
+ end
17
+ end
@@ -1,4 +1,4 @@
1
1
  module DaFunk
2
- VERSION="3.28.2"
2
+ VERSION="3.29.0"
3
3
  end
4
4
 
@@ -0,0 +1,18 @@
1
+ class SecureRandomTest < DaFunk::Test.case
2
+ def setup
3
+ @uuid = DaFunk::SecureRandom.uuid
4
+ @random_bytes = DaFunk::SecureRandom.random_bytes
5
+ end
6
+
7
+ def test_uuid
8
+ assert_equal(36, @uuid.size)
9
+
10
+ # Check time_hi_and_version and clock_seq_hi_res bits (RFC 4122 4.4)
11
+ assert_equal('4', @uuid[14])
12
+ assert_include(%w'8 9 a b', @uuid[19])
13
+ end
14
+
15
+ def test_random_bytes
16
+ assert_equal(16, @random_bytes.size)
17
+ end
18
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: da_funk
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.28.2
4
+ version: 3.29.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thiago Scalone
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-07 00:00:00.000000000 Z
11
+ date: 2020-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -174,6 +174,7 @@ files:
174
174
  - lib/da_funk/rake_task.rb
175
175
  - lib/da_funk/screen.rb
176
176
  - lib/da_funk/screen_flow.rb
177
+ - lib/da_funk/secure_random.rb
177
178
  - lib/da_funk/struct.rb
178
179
  - lib/da_funk/test.rb
179
180
  - lib/da_funk/transaction/download.rb
@@ -220,6 +221,7 @@ files:
220
221
  - test/resources/shared/bitmap_gp.dat
221
222
  - test/test_helper.rb
222
223
  - test/unit/da_funk/event_listener_test.rb
224
+ - test/unit/da_funk/secure_random.rb
223
225
  - test/unit/da_funk/struct_test.rb
224
226
  - test/unit/da_funk/support_test.rb
225
227
  - test/unit/device/application_test.rb
@@ -269,6 +271,7 @@ test_files:
269
271
  - test/resources/shared/bitmap_gp.dat
270
272
  - test/test_helper.rb
271
273
  - test/unit/da_funk/event_listener_test.rb
274
+ - test/unit/da_funk/secure_random.rb
272
275
  - test/unit/da_funk/struct_test.rb
273
276
  - test/unit/da_funk/support_test.rb
274
277
  - test/unit/device/application_test.rb