passlock 0.0.4 → 0.0.5
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/lib/passlock/class.rb +6 -0
- data/lib/passlock/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3a3ba1dc65c64b1e78baa629e9eb5caaf944006
|
4
|
+
data.tar.gz: f49c1fb9eb58c57435e5bfdf673620ed5d7a1e94
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92b6950104907b2174839346bffa9bd25960c7b1e02a564fcf33d81efdd8c856b83533f47165d9004396b49e3b96c72b21c80620af1135c0530d1ecbde83c476
|
7
|
+
data.tar.gz: 8ab254d11e47f2009ddff9b0025f044d55b5341243bbc95fadf8a63078f62b689c03ec5b3e76bba9f44d29e90ca300f9ee28cf5257c467ef1865eb360f2ca832
|
data/lib/passlock/class.rb
CHANGED
@@ -3,27 +3,33 @@ require 'digest/sha1'
|
|
3
3
|
require 'digest/sha2'
|
4
4
|
require 'hmac-sha1'
|
5
5
|
class String
|
6
|
+
# @see PassLock#base64
|
6
7
|
def to_base
|
7
8
|
Base64.encode64 self
|
8
9
|
end
|
9
10
|
alias_method :to_base64, to_base
|
10
11
|
|
12
|
+
# @see PassLock#sha1
|
11
13
|
def to_sha1
|
12
14
|
Digest::SHA1.hexdigest self
|
13
15
|
end
|
14
16
|
|
17
|
+
# @see PassLock#sha256
|
15
18
|
def to_sha256
|
16
19
|
Digest::SHA256.new().update(self).to_s
|
17
20
|
end
|
18
21
|
|
22
|
+
# @see PassLock#sha384
|
19
23
|
def to_sha384
|
20
24
|
Digest::SHA384.new().update(self).to_s
|
21
25
|
end
|
22
26
|
|
27
|
+
# @see PassLock#sha512
|
23
28
|
def to_sha512
|
24
29
|
Digest::SHA512.new().update(self).to_s
|
25
30
|
end
|
26
31
|
|
32
|
+
# @see PassLock#base64hash
|
27
33
|
def to_basehash
|
28
34
|
Base64.encode64((HMAC::SHA1.new(self) << 'base').digest).strip
|
29
35
|
end
|
data/lib/passlock/version.rb
CHANGED