kryptonita 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -0
- data/kryptonita.gemspec +2 -1
- data/lib/kryptonita.rb +5 -0
- data/lib/kryptonita/version.rb +1 -1
- data/spec/kryptonita/hash_spec.rb +17 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbd98b7d72515a5008909a00087689f01dac72d6
|
4
|
+
data.tar.gz: 0682a84e224ebe0bce24833d7cc402de1930841e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7fb1a3a89f3704ccd54fc19753a2d4de0c2edaab91f752f33a9d62c1bcab0b30bfb6e53fd8c3d45f235b3e11843a0550801dfdad0790ae76864ebd495251c9e
|
7
|
+
data.tar.gz: cb236a627433f8acf147de38f38357526a2faf40d91eff9116a17e0fbb485f63500f404f44ee4dd69222dde32b0eb68ad79232abdade69ebc3214aaa52f2c92b
|
data/README.md
CHANGED
@@ -29,6 +29,14 @@ Kryptonita::Hash.whirlpool("ruby")
|
|
29
29
|
# => "95fc6a05b1edd849a202d9cdb1158930cf1e101900357a8816b743520710be2487c890c3bfb2b70f2308f7e8737473a477bb44950516c23e53a2993091faa9d2"
|
30
30
|
```
|
31
31
|
|
32
|
+
## Implemented methods
|
33
|
+
|
34
|
+
|
35
|
+
```ruby
|
36
|
+
Kryptonita::Hash.whirlpool(str)
|
37
|
+
Kryptonita::Hash.sha512(str)
|
38
|
+
``
|
39
|
+
|
32
40
|
## Contributing
|
33
41
|
|
34
42
|
1. Fork it ( https://github.com/AngoDev/kryptonita/fork )
|
data/kryptonita.gemspec
CHANGED
@@ -18,7 +18,8 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
+
spec.required_ruby_version = ">= 2.0.0"
|
21
22
|
spec.add_development_dependency "bundler", "~> 1.7"
|
22
23
|
spec.add_development_dependency "rake", "~> 10.0"
|
23
|
-
spec.add_development_dependency "rspec"
|
24
|
+
spec.add_development_dependency "rspec", "~> 3.1.0"
|
24
25
|
end
|
data/lib/kryptonita.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require "kryptonita/version"
|
2
2
|
require "whirlpool/whirlpool"
|
3
|
+
require "digest/sha2"
|
3
4
|
|
4
5
|
module Kryptonita
|
5
6
|
class Hash
|
@@ -9,5 +10,9 @@ module Kryptonita
|
|
9
10
|
w.print_string(str).downcase
|
10
11
|
end
|
11
12
|
|
13
|
+
def self.sha512(str)
|
14
|
+
Digest::SHA512.hexdigest(str)
|
15
|
+
end
|
16
|
+
|
12
17
|
end
|
13
18
|
end
|
data/lib/kryptonita/version.rb
CHANGED
@@ -19,5 +19,22 @@ module Kryptonita
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
+
|
23
|
+
describe "#sha512" do
|
24
|
+
let(:hashed) { Kryptonita::Hash.sha512("ruby") }
|
25
|
+
|
26
|
+
it "returns a string" do
|
27
|
+
expect(hashed).to be_a(String)
|
28
|
+
end
|
29
|
+
|
30
|
+
it "returns a string with a size 128" do
|
31
|
+
expect(hashed.size).to eq(128)
|
32
|
+
end
|
33
|
+
|
34
|
+
it "returns a correct hash" do
|
35
|
+
expect(hashed).to eql("423408d7723a3d80baefa804bd50b61a89667efec1713386a7b8efe28e5d13968307a908778cad210d7aa2dfe7db9a2aa86895f9fc1eeefcc99814310b207a6b")
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
22
39
|
end
|
23
40
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kryptonita
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrício dos Santos
|
@@ -42,16 +42,16 @@ dependencies:
|
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 3.1.0
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 3.1.0
|
55
55
|
description: Kryptonita is a Ruby gem that provides a lot of functions for hashing,
|
56
56
|
encrypt and decrypt.
|
57
57
|
email:
|
@@ -90,7 +90,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
90
90
|
requirements:
|
91
91
|
- - '>='
|
92
92
|
- !ruby/object:Gem::Version
|
93
|
-
version:
|
93
|
+
version: 2.0.0
|
94
94
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
95
|
requirements:
|
96
96
|
- - '>='
|