passlock 0.0.6 → 0.0.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 26eb8e67214b0f31c36a251687d4f9d4bed5a0b2
4
- data.tar.gz: 8128e88426c9f8e7c38a66deba3d5b398cd00a79
3
+ metadata.gz: 3be22e9ce2d359eac877906854898a3da32931a7
4
+ data.tar.gz: 516497ac478c00bba91ec2f3f53755d1672e5c64
5
5
  SHA512:
6
- metadata.gz: 9d72a5389a118d9e7191e1f7e8d814c5ca526059775fda22b6b373e81e85eaca41cd63435699d4ba7bbd61d5d79ee3b399b93fae308ed0401769100c3185922b
7
- data.tar.gz: 7474d629676e56bb4eb2f16f9a56d772c06346341c4cef44b8c7988325a68ceba3b5cd8ba3e0700627e3b9b0b548e57e0b78d09e87488ce0f3acd977f46d5462
6
+ metadata.gz: c8cb9c08df6d6b0eb37e059c4294c4422b5d621448275e86911451ed118d0f510266556317b2007df931ca8b2383f45bfe1b7563890b1ea778ab5de83ebb69f2
7
+ data.tar.gz: 27ee12e6ee15957dbdd6f32a1f48c49389dd3819cd70be70f77884948274aab54e6c1649e1b69073777ba8b77f15af7a2ef3f9432394da3f9f2b298790b414e5
@@ -25,9 +25,7 @@ module PassLock
25
25
  chars = []
26
26
  result = ""
27
27
  options.each do |flag|
28
- if not @opts[flag].nil?
29
- chars.concat(@opts[flag].scan(/./))
30
- end
28
+ chars.concat(@opts[flag].scan(/./)) unless !@opts[flag].nil?
31
29
  end
32
30
  length.to_i.times do
33
31
  result += chars.sample
@@ -69,7 +67,7 @@ module PassLock
69
67
  # @return [String] The SHA256 hash
70
68
  def self.sha256(pass, layers: 1)
71
69
  layers.times do
72
- pass = Digest::SHA256.new().update(pass).to_s
70
+ pass = Digest::SHA256.new.update(pass).to_s
73
71
  end
74
72
  pass
75
73
  end
@@ -79,10 +77,10 @@ module PassLock
79
77
  # @param layers [Fixnum] The amount of layering
80
78
  # @return [String] The SHA384 hash
81
79
  def self.sha384(pass, layers: 1)
82
- layers.times do
83
- pass = Digest::SHA384.new.update(pass).to_s
84
- end
85
- pass
80
+ layers.times do
81
+ pass = Digest::SHA384.new.update(pass).to_s
82
+ end
83
+ pass
86
84
  end
87
85
 
88
86
  # Creats a SHA512 hash.
@@ -9,7 +9,7 @@ class String
9
9
  def to_base
10
10
  Base64.encode64 self
11
11
  end
12
- alias_method :to_base64, to_base
12
+ alias_method :to_base64, :to_base
13
13
 
14
14
  # @see PassLock#sha1
15
15
  def to_sha1
@@ -35,5 +35,5 @@ class String
35
35
  def to_basehash
36
36
  Base64.encode64((HMAC::SHA1.new(self) << 'base').digest).strip
37
37
  end
38
- alias_method :to_base64hash, to_basehash
38
+ alias_method :to_base64hash, :to_basehash
39
39
  end
@@ -1,4 +1,4 @@
1
1
  module PassLock
2
2
  # The version of the gem installed.
3
- VERSION = '0.0.6'.freeze
3
+ VERSION = '0.0.7'.freeze
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: passlock
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Snazzah