rotp 5.0.0 → 5.1.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: 592d8529aae80f05496b4f96d5888bbffd27f3afd92f2bad98b25a6b8046eee4
4
- data.tar.gz: fbc30ba953e373b330df098c2ade00a2bac6cd635d8d488ceaafd3456f41f847
3
+ metadata.gz: 21758aaaffd88bc9b2042b13f269b8ea16e93aa870a02f8538d688d2290dfe6d
4
+ data.tar.gz: 57e7983b8321fcf43982436b9ebc0aaad1ed5248e8a3359a6fefeafdf139527d
5
5
  SHA512:
6
- metadata.gz: a9e61bbec32b47a1c52c781186dc1d2ef60be00242b70e6ce4c151bf9f4e964cbd402f4e1a0b5f2cddae61787548f927e8f4bcfee3d0c0ceeb32dfa419456eb5
7
- data.tar.gz: 96c14aa35cc5c7a359d559b8e4d7d8c29cf2fce8a44d92c125af8552002775d7fa5498b443e4cb5fd0d0a1fafceb695d6fee979a5897c33b9316f1283b8eccf6
6
+ metadata.gz: 58d61e11ce0ef3a2f6fc7e0e8ca577f2e93dc4c8f5bb2b880a5cb5428beccfca09723871b4d3b256d20f3c8f7246cb5b6128af9bd63ca38a039e50e10ec60314
7
+ data.tar.gz: 2f47df80e1d3f4f84005183f9963f589e64a6cb1a2d35dc1cf15bb33cce707de2cf048f5569c7c778f93dbad63f619e16c530cdafdcb092bc3025fbd44e994ff
@@ -1,5 +1,10 @@
1
1
  ### Changelog
2
2
 
3
+ ### 5.1.0
4
+
5
+ - Create `random_base32` to perform `random` to avoid breaking changes
6
+ - Still needed to bump to 5.x due to Base32 cleanup
7
+
3
8
  ### 5.0.0
4
9
 
5
10
  - Clean up base32 implementation to match Google Autheticator
@@ -58,6 +58,12 @@ module ROTP
58
58
  self.encode(rand_bytes)
59
59
  end
60
60
 
61
+ # Prevent breaking changes
62
+ def random_base32(str_len = 32)
63
+ byte_length = str_len * 5/8
64
+ random(byte_length)
65
+ end
66
+
61
67
  private
62
68
 
63
69
  def decode_quint(q)
@@ -1,3 +1,3 @@
1
1
  module ROTP
2
- VERSION = '5.0.0'.freeze
2
+ VERSION = '5.1.0'.freeze
3
3
  end
@@ -22,6 +22,14 @@ RSpec.describe ROTP::Base32 do
22
22
  expect(ROTP::Base32.decode(base32).length).to eq 48
23
23
  end
24
24
  end
25
+
26
+ context 'alias to older random_base32' do
27
+ let(:base32) { ROTP::Base32.random_base32(36) }
28
+ it 'is base32 charset' do
29
+ expect(base32.length).to eq 36
30
+ expect(ROTP::Base32.decode(base32).length).to eq 22
31
+ end
32
+ end
25
33
  end
26
34
 
27
35
  describe '.decode' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rotp
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0
4
+ version: 5.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Percival
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-28 00:00:00.000000000 Z
11
+ date: 2019-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable