totp 1.0.0 → 1.0.1

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.
Files changed (5) hide show
  1. checksums.yaml +5 -5
  2. data/CONTRIBUTING +19 -0
  3. data/lib/totp.rb +2 -2
  4. data/totp.gemspec +1 -1
  5. metadata +11 -11
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: dc0d44097f7757f0363bb7ce7eaa4f236f86b0eb
4
- data.tar.gz: 18c991e130d749c77a59da809066fe869a4f4623
2
+ SHA256:
3
+ metadata.gz: f019295f8227bdb0c60d6f0fe19a2a6826c49b727910957acfe955922b9bcfa2
4
+ data.tar.gz: ec85684a05120fa5bb311955aab3f9e60be28ad1db7997e9502629c27464d0c0
5
5
  SHA512:
6
- metadata.gz: bb98acd87360c4b57f497aa7216cd9ab45ec2f7291c07ba04dcbd58ecc73cb5e0411653a7b2a1441ed54c82966c5975ec7314a5fc80d57e084c7a9ec85692c23
7
- data.tar.gz: 3b844ad850ebddad6940991f021cf7a17e57949f4df79dc636fbde0f6821d12397b747863bea4425ff34168441fa425b1a8482ff7a18396a88dc8206d0350934
6
+ metadata.gz: bde39a825aff4df455c8bf413439e1ca23de0b4c596369650f87c0eb07cfddabdbc16df2cc2c35cf27fdb3abc480110a72393e65af320fce02176efedc69ca5f
7
+ data.tar.gz: 30115f692d3300cd29771111292e1ad38c680c7bb39a330e7f0465c1226ba4f99ddc62b82763b24057286b3a57cc1aec5ad633882f4255dabd2bd16e9749107d
data/CONTRIBUTING ADDED
@@ -0,0 +1,19 @@
1
+ This code tries to solve a particular problem with a very simple
2
+ implementation. We try to keep the code to a minimum while making
3
+ it as clear as possible. The design is very likely finished, and
4
+ if some feature is missing it is possible that it was left out on
5
+ purpose. That said, new usage patterns may arise, and when that
6
+ happens we are ready to adapt if necessary.
7
+
8
+ A good first step for contributing is to meet us on IRC and discuss
9
+ ideas. We spend a lot of time on #lesscode at freenode, always ready
10
+ to talk about code and simplicity. If connecting to IRC is not an
11
+ option, you can create an issue explaining the proposed change and
12
+ a use case. We pay a lot of attention to use cases, because our
13
+ goal is to keep the code base simple. Usually the result of a
14
+ conversation is the creation of a different tool.
15
+
16
+ Please don't start the conversation with a pull request. The code
17
+ should come at last, and even though it may help to convey an idea,
18
+ more often than not it draws the attention to a particular
19
+ implementation.
data/lib/totp.rb CHANGED
@@ -10,11 +10,11 @@ module TOTP
10
10
 
11
11
  # Return whether or not the key is valid for the given secret
12
12
  def self.valid?(secret, pass, time = Time.now)
13
- return self.passwords(secret, time).include?(pass)
13
+ return self.passwords(secret, time).include?(Integer(pass))
14
14
  end
15
15
 
16
16
  def self.totp(hmac, time)
17
- bytes = [time].pack('>q').reverse
17
+ bytes = [time].pack('q<').reverse
18
18
 
19
19
  hmac.reset
20
20
  hmac.update(bytes)
data/totp.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "totp"
3
- s.version = "1.0.0"
3
+ s.version = "1.0.1"
4
4
  s.summary = "Time-based One-Time Passwords"
5
5
  s.description = "Time-based One-Time Passwords"
6
6
  s.authors = ["Michel Martens"]
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: totp
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michel Martens
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-09 00:00:00.000000000 Z
11
+ date: 2024-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base32
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: cutest
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  description: Time-based One-Time Passwords
@@ -45,7 +45,8 @@ executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
- - .gems
48
+ - ".gems"
49
+ - CONTRIBUTING
49
50
  - LICENSE
50
51
  - README.md
51
52
  - lib/totp.rb
@@ -61,17 +62,16 @@ require_paths:
61
62
  - lib
62
63
  required_ruby_version: !ruby/object:Gem::Requirement
63
64
  requirements:
64
- - - '>='
65
+ - - ">="
65
66
  - !ruby/object:Gem::Version
66
67
  version: '0'
67
68
  required_rubygems_version: !ruby/object:Gem::Requirement
68
69
  requirements:
69
- - - '>='
70
+ - - ">="
70
71
  - !ruby/object:Gem::Version
71
72
  version: '0'
72
73
  requirements: []
73
- rubyforge_project:
74
- rubygems_version: 2.0.3
74
+ rubygems_version: 3.0.3.1
75
75
  signing_key:
76
76
  specification_version: 4
77
77
  summary: Time-based One-Time Passwords