the_encrypted_string 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/gem_version.rb +1 -1
- data/lib/the_encrypted_string.rb +4 -2
- 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: caf0bc7770a9e9c67464bf8ecec7cfc1db36b9d7
|
4
|
+
data.tar.gz: 155d60c8b53279c168a2753344ec01bc1f87b076
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1185f0bc0da2143d7d0d5d907a9b3877a8359c4e1933752afb4feddc6978b8a15974ca53a722614135db4e480428e54302d5a252966c0921ced0b8e13925129c
|
7
|
+
data.tar.gz: a2f4ea62d334910a9291b09359723411d0ff7d0191c57291edafd16f2f4d01c80c3d5fe2e037803d7221621596a7dc9efae08b79e8ecd242842e2243244727ff
|
data/gem_version.rb
CHANGED
data/lib/the_encrypted_string.rb
CHANGED
@@ -13,10 +13,12 @@ Encryptor.default_options.merge!(
|
|
13
13
|
|
14
14
|
class String
|
15
15
|
def to_the_encrypted
|
16
|
-
|
16
|
+
encrypted_str = Encryptor.encrypt(self)
|
17
|
+
Base64.urlsafe_encode64 encrypted_str
|
17
18
|
end
|
18
19
|
|
19
20
|
def to_the_decrypted
|
20
|
-
Base64.urlsafe_decode64(self)
|
21
|
+
encrypted_str = Base64.urlsafe_decode64(self)
|
22
|
+
Encryptor.decrypt encrypted_str
|
21
23
|
end
|
22
24
|
end
|