sha3-pure-ruby 0.0.1 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{travis.yml → .travis.yml} +0 -0
- data/README.md +25 -13
- data/lib/sha3-pure-ruby/version.rb +1 -1
- data/sha3-pure-ruby.gemspec +1 -0
- data/test/test_sha3-pure-ruby.rb +46 -3
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d1e1ee171f8a07eb5253aa3ed771a17d80c92f7
|
4
|
+
data.tar.gz: 36736b4834b50f832b87622ad9ff29ec98c6ee7c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cef2c4abbbc1d3852c07c01238286e8da1d2c2375e02110cf075e858b0f02b71fc3b076994fe3d18d9d6c16e02b3ce3f612f8fb8483e1bed90cc7b1443c3e798
|
7
|
+
data.tar.gz: 9b15e3d1217d816109498ca37e847d29865474151a3ebd0c48cc1546df5092ac28609437de53cdac0718bf8b0d9b1af63a12dbf94ce00860bf7ce6e16b0e3e93
|
data/{travis.yml → .travis.yml}
RENAMED
File without changes
|
data/README.md
CHANGED
@@ -1,32 +1,44 @@
|
|
1
1
|
# Pure Ruby SHA3 Gem
|
2
|
+
[![Build Status](https://travis-ci.org/havenwood/sha3-pure-ruby.png?branch=master)](https://travis-ci.org/havenwood/sha3-pure-ruby)
|
2
3
|
|
3
4
|
A pure Ruby implementation of SHA3.
|
4
5
|
|
5
6
|
## Installation
|
6
7
|
|
7
|
-
Install it
|
8
|
+
Install it from the command line:
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
gem 'sha3-pure-ruby'
|
10
|
+
```bash
|
11
|
+
gem install sha3-pure-ruby
|
12
|
+
```
|
14
13
|
|
15
|
-
|
14
|
+
Or execute `bundle` after adding this line to your app's Gemfile:
|
16
15
|
|
17
|
-
|
16
|
+
```ruby
|
17
|
+
gem 'sha3-pure-ruby'
|
18
|
+
```
|
18
19
|
|
19
20
|
## Usage
|
20
21
|
|
21
22
|
```ruby
|
22
|
-
Digest::SHA3.new.hexdigest ''
|
23
|
-
#=> "
|
23
|
+
Digest::SHA3.new.hexdigest 'default 512-bit'
|
24
|
+
#=> "26dce8c3ea8e5ffbfbf684070ca59f9635487942bfc220b9fe94bf9b2f8a7dfa2e4e85059ead3c92f14e5d2e06076eb6643adf50481976bd52f737f89b185ae2"
|
25
|
+
|
26
|
+
Digest::SHA3.new(224).hexdigest 'example 224-bit'
|
27
|
+
#=> "d6e8cef46de550a1b50ca920c4600a6e1512af055034c45a33849133"
|
24
28
|
```
|
25
29
|
|
30
|
+
## Compatibility
|
31
|
+
|
32
|
+
- Ruby 2.0.0
|
33
|
+
- Ruby 1.9.3
|
34
|
+
- Ruby 1.9.2
|
35
|
+
- JRuby
|
36
|
+
- Rubinius
|
37
|
+
|
26
38
|
## License
|
27
39
|
|
28
|
-
|
29
|
-
|
30
|
-
Refactored, tests added, and cut into a gem by Shannon Skipper.
|
40
|
+
Creative Commons
|
41
|
+
|
42
|
+
To the extent possible under law, Christian Neukirchen has waived all copyright and related or neighboring rights to the source code of the original Ruby implementation. Performance enhancements added by Clemens Gruber. Refactored, tests added, and cut into a gem by Shannon Skipper. You can copy, modify, distribute and perform this work, even for commercial purposes, all without asking permission:
|
31
43
|
|
32
44
|
[https://creativecommons.org/publicdomain/zero/1.0/](https://creativecommons.org/publicdomain/zero/1.0/)
|
data/sha3-pure-ruby.gemspec
CHANGED
data/test/test_sha3-pure-ruby.rb
CHANGED
@@ -3,9 +3,52 @@ require 'minitest/autorun'
|
|
3
3
|
require 'minitest/pride'
|
4
4
|
|
5
5
|
describe Digest::SHA3 do
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
describe 'default 512-bit' do
|
7
|
+
it 'should work when empty' do
|
8
|
+
empty_string_sha3 = '0eab42de4c3ceb9235fc91acffe746b29c29a8c366b7c60e4e67c466f36a4304c00fa9caf9d87976ba469bcbe06713b435f091ef2769fb160cdab33d3670680e'
|
9
|
+
assert_equal Digest::SHA3.new.hexdigest(''), empty_string_sha3
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'should work with content' do
|
13
|
+
cat_sha3 = "b2faf80c85bd36029dc3f804cbf439888fd1ca195ab0e3decb872f8aa9ef767e4866186ebb8b5ecfa1237147a94775f8302648be0fd0ae3a6ebbdf931f423360"
|
14
|
+
assert_equal Digest::SHA3.new.hexdigest('cat'), cat_sha3
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
describe '384-bit' do
|
19
|
+
it 'should work when empty' do
|
20
|
+
empty_string_sha3 = '2c23146a63a29acf99e73b88f8c24eaa7dc60aa771780ccc006afbfa8fe2479b2dd2b21362337441ac12b515911957ff'
|
21
|
+
assert_equal Digest::SHA3.new(384).hexdigest(''), empty_string_sha3
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'should work with content' do
|
25
|
+
cat_sha3 = 'fbcae9b945da6967b622e93e5712dcd0b4df2f522a89b0a20b485684c02efcf9efafb699499b2328172cbf654b7721c5'
|
26
|
+
assert_equal Digest::SHA3.new(384).hexdigest('cat'), cat_sha3
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
describe '256-bit' do
|
31
|
+
it 'should work when empty' do
|
32
|
+
empty_string_sha3 = 'c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470'
|
33
|
+
assert_equal Digest::SHA3.new(256).hexdigest(''), empty_string_sha3
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'should work with content' do
|
37
|
+
cat_sha3 = '52763589e772702fa7977a28b3cfb6ca534f0208a2b2d55f7558af664eac478a'
|
38
|
+
assert_equal Digest::SHA3.new(256).hexdigest('cat'), cat_sha3
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
describe '224-bit' do
|
43
|
+
it 'should work when empty' do
|
44
|
+
empty_string_sha3 = 'f71837502ba8e10837bdd8d365adb85591895602fc552b48b7390abd'
|
45
|
+
assert_equal Digest::SHA3.new(224).hexdigest(''), empty_string_sha3
|
46
|
+
end
|
47
|
+
|
48
|
+
it 'should work with content' do
|
49
|
+
cat_sha3 = "c3e4d225cefd1d01166d801f856907492b3bf8909a8a3a5bc922580f"
|
50
|
+
assert_equal Digest::SHA3.new(224).hexdigest('cat'), cat_sha3
|
51
|
+
end
|
9
52
|
end
|
10
53
|
end
|
11
54
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sha3-pure-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- havenwood
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: minitest
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
description: An implementation of SHA3 in pure Ruby.
|
28
42
|
email:
|
29
43
|
- shannonskipper@gmail.com
|
@@ -32,6 +46,7 @@ extensions: []
|
|
32
46
|
extra_rdoc_files: []
|
33
47
|
files:
|
34
48
|
- .gitignore
|
49
|
+
- .travis.yml
|
35
50
|
- Gemfile
|
36
51
|
- Gemfile.lock
|
37
52
|
- README.md
|
@@ -40,7 +55,6 @@ files:
|
|
40
55
|
- lib/sha3-pure-ruby/version.rb
|
41
56
|
- sha3-pure-ruby.gemspec
|
42
57
|
- test/test_sha3-pure-ruby.rb
|
43
|
-
- travis.yml
|
44
58
|
homepage: https://github.com/havenwood/sha3-pure-ruby
|
45
59
|
licenses:
|
46
60
|
- https://creativecommons.org/publicdomain/zero/1.0/
|