We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 703bee1 commit 8456d5eCopy full SHA for 8456d5e
CHANGELOG.md
@@ -1,5 +1,9 @@
1
### Changelog
2
3
+### 6.2.2
4
+
5
+- Removed `rjust` from `generate_otp` in favor of more time constant version
6
7
### 6.2.1
8
9
- Removed old rdoc folder that was triggering a security warning due to an
lib/rotp/otp.rb
@@ -32,7 +32,8 @@ def generate_otp(input)
32
(hmac[offset + 1].ord & 0xff) << 16 |
33
(hmac[offset + 2].ord & 0xff) << 8 |
34
(hmac[offset + 3].ord & 0xff)
35
- (code % 10**digits).to_s.rjust(digits, '0')
+ code_str = (10 ** digits + (code % 10 ** digits)).to_s
36
+ code_str[-digits..-1]
37
end
38
39
private
lib/rotp/version.rb
@@ -1,3 +1,3 @@
module ROTP
- VERSION = '6.2.1'.freeze
+ VERSION = '6.2.2'.freeze
0 commit comments