Skip to content

Commit c384628

Browse files
committed
Update to v5.0.0 due to breaking change to 'Base32.random' API
1 parent 63ffbca commit c384628

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
### Changelog
22

3+
### 5.0.0
4+
5+
- Clean up base32 implementation to match Google Autheticator
6+
- BREAKING `Base32.random_base32` renamed to random
7+
- The argument is now byte length vs output string length for more precise bit strengths
8+
39
### 4.1.0
410

511
- Add a digest option to the CLI #83

README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,16 @@ Many websites use this for [multi-factor authentication](https://www.youtube.com
1616
* OpenSSL
1717
* Ruby 2.0 or higher
1818

19-
## Breaking changes in >= 4.0
19+
## Breaking changes
20+
21+
### Breaking changes in >= 5.0
22+
23+
- `ROTP::Base32.random_base32` is now `ROTP::Base32.random` and the argument
24+
has changed from secret string length to byte length to allow for more
25+
precision
26+
- Cleaned up the Base32 implementation to better match Google Authenticator's version
27+
28+
### Breaking changes in >= 4.0
2029

2130
- Simplified API
2231
- `verify` now takes options for `drift` and `after`
@@ -108,7 +117,7 @@ totp.verify("250939", drift_behind: 15, at: now + 45) # => nil
108117
### Generating a Base32 Secret key
109118

110119
```ruby
111-
ROTP::Base32.random_base32 # returns a 32 character base32 secret. Compatible with Google Authenticator
120+
ROTP::Base32.random # returns a 160 bit (32 character) base32 secret. Compatible with Google Authenticator
112121
```
113122

114123
Note: The Base32 format conforms to [RFC 4648 Base32](http://en.wikipedia.org/wiki/Base32#RFC_4648_Base32_alphabet)
@@ -150,7 +159,7 @@ bundle install
150159
bundle exec rspec
151160
```
152161

153-
### Testign with Docker
162+
### Testing with Docker
154163

155164
In order to make it easier to test against different ruby version, ROTP comes
156165
with a set of Dockerfiles for each version that we test against in Travis
@@ -162,7 +171,7 @@ docker run --rm -v $(pwd):/usr/src/app rotp_2.6
162171

163172
## Executable Usage
164173

165-
The rotp rubygem includes an executable for helping with testing and debugging
174+
The rotp rubygem includes CLI version to help with testing and debugging
166175

167176
```bash
168177
# Try this to get an overview of the commands

lib/rotp/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module ROTP
2-
VERSION = '4.1.0'.freeze
2+
VERSION = '5.0.0'.freeze
33
end

0 commit comments

Comments
 (0)