otp 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +8 -1
- data/lib/otp/base.rb +1 -1
- data/lib/otp/version.rb +1 -1
- data/otp.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2cff8ad3604a6598f352b74b34c4e9414117a59
|
4
|
+
data.tar.gz: ea8d49ef4dfcf5fd5f0b56864e62c30ada976aac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f215a20f4330cad4bea4b5758175784dd9db09f15b417a8db3d1e17386268ee6019dccae63074ddf9ffd6bf9179d4a08700096447c5ef1f42dda2b5128c4617
|
7
|
+
data.tar.gz: 2d18ba3ef5dadff11b78327dae54f2060c4b1b82a2afdbfba9b1de80ddcd92de4e6e92b51c8821022bb2a38627def98121693b8916f400037dc09524c21fc829
|
data/README.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# One-Time Password Library
|
2
2
|
|
3
|
+
[](https://travis-ci.org/gotoyuzo/otp)
|
4
|
+
[](https://rubygems.org/gems/otp)
|
5
|
+
[](https://github.com/gotoyuzo/otp/blob/master/LICENSE.txt)
|
6
|
+
|
3
7
|
This library provides an implementation of
|
4
8
|
HMAC-Based One-Time Password Algorithm (HOTP; RFC4226) and
|
5
9
|
Time-Based One-Time Password Algorithm (HOTP; RFC6238).
|
@@ -14,14 +18,17 @@ To create new TOTP secret:
|
|
14
18
|
|
15
19
|
require "otp"
|
16
20
|
|
21
|
+
# Create a TOTP instance and new key
|
17
22
|
totp = OTP::TOTP.new
|
18
23
|
totp.new_secret # create random secret
|
24
|
+
p totp.password #=> "123456" (password for the current time)
|
25
|
+
|
26
|
+
# Inspect TOTP parameters
|
19
27
|
p totp.secret #=> "YVMR2G7N4OAXGKFC" (BASE32-formated HMAC key)
|
20
28
|
p totp.algorithm #=> "SHA1" (HMAC algorithm; default SHA1)
|
21
29
|
p totp.digits #=> 6 (number of password digits; default 6)
|
22
30
|
p totp.period #=> 30 (time step period in second; default 30)
|
23
31
|
p totp.time #=> nil (UNIX time by Time or Integer; nil for the current time)
|
24
|
-
p totp.password #=> "123456" (password for the current time)
|
25
32
|
|
26
33
|
# Format TOTP URI. Otpauth scheme URLs can be read by OTP::URI.parse.
|
27
34
|
totp.issuer = "My Company"
|
data/lib/otp/base.rb
CHANGED
data/lib/otp/version.rb
CHANGED
data/otp.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["gotoyuzo@notwork.org"]
|
11
11
|
spec.summary = %q{One-Time Password Library}
|
12
12
|
spec.description = %q{An implementation of HOTP (RFC4226) and TOTP (RFC6238).}
|
13
|
-
spec.homepage = ""
|
13
|
+
spec.homepage = "https://github.com/gotoyuzo/otp"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: otp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuuzou Gotou
|
@@ -63,7 +63,7 @@ files:
|
|
63
63
|
- test/test_hotp.rb
|
64
64
|
- test/test_totp.rb
|
65
65
|
- test/test_uri.rb
|
66
|
-
homepage:
|
66
|
+
homepage: https://github.com/gotoyuzo/otp
|
67
67
|
licenses:
|
68
68
|
- MIT
|
69
69
|
metadata: {}
|