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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 454ede6b3b6a58124b12318611d00bc4590a52a4
4
- data.tar.gz: 3f00505cc75d45c90759f258a1d1bdb73cc6b4f5
3
+ metadata.gz: 9d1e1ee171f8a07eb5253aa3ed771a17d80c92f7
4
+ data.tar.gz: 36736b4834b50f832b87622ad9ff29ec98c6ee7c
5
5
  SHA512:
6
- metadata.gz: d68106a9854cff672c1131d6e07e623ae794b19ffd146fc05b497e5f3b47d3cbacca1ac8fe5add04af8b229a9816502fb81cba1992aaecc5c4c606435ce7ed1e
7
- data.tar.gz: 2888bad8a3ca3f787580747b299877b5293ae0a1b99b7479e645ea52767b6cc3ceeae8708e2d1ab133720cbe2e87d6496d4e0a290f624c0eb08d71dbfa39f5b7
6
+ metadata.gz: cef2c4abbbc1d3852c07c01238286e8da1d2c2375e02110cf075e858b0f02b71fc3b076994fe3d18d9d6c16e02b3ce3f612f8fb8483e1bed90cc7b1443c3e798
7
+ data.tar.gz: 9b15e3d1217d816109498ca37e847d29865474151a3ebd0c48cc1546df5092ac28609437de53cdac0718bf8b0d9b1af63a12dbf94ce00860bf7ce6e16b0e3e93
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 yourself:
8
+ Install it from the command line:
8
9
 
9
- $ gem install sha3-pure-ruby
10
-
11
- Or add this line to your app's Gemfile:
12
-
13
- gem 'sha3-pure-ruby'
10
+ ```bash
11
+ gem install sha3-pure-ruby
12
+ ```
14
13
 
15
- And then execute:
14
+ Or execute `bundle` after adding this line to your app's Gemfile:
16
15
 
17
- $ bundle
16
+ ```ruby
17
+ gem 'sha3-pure-ruby'
18
+ ```
18
19
 
19
20
  ## Usage
20
21
 
21
22
  ```ruby
22
- Digest::SHA3.new.hexdigest ''
23
- #=> "0eab42de4c3ceb9235fc91acffe746b29c29a8c366b7c60e4e67c466f36a4304c00fa9caf9d87976ba469bcbe06713b435f091ef2769fb160cdab33d3670680e"
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
- To the extent possible under law, Christian Neukirchen has waived all copyright and related or neighboring rights to the source code in this file.
29
- Minor changes by Clemens Gruber.
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/)
@@ -1,3 +1,3 @@
1
1
  class SHA3
2
- VERSION = '0.0.1'
2
+ VERSION = '0.1.1'
3
3
  end
@@ -17,4 +17,5 @@ Gem::Specification.new do |spec|
17
17
  spec.test_files = spec.files.grep %r{^(test)/}
18
18
  spec.require_paths = ['lib']
19
19
  spec.add_development_dependency 'rake'
20
+ spec.add_development_dependency 'minitest'
20
21
  end
@@ -3,9 +3,52 @@ require 'minitest/autorun'
3
3
  require 'minitest/pride'
4
4
 
5
5
  describe Digest::SHA3 do
6
- it 'should work' do
7
- empty_string_sha3 = '0eab42de4c3ceb9235fc91acffe746b29c29a8c366b7c60e4e67c466f36a4304c00fa9caf9d87976ba469bcbe06713b435f091ef2769fb160cdab33d3670680e'
8
- assert_equal Digest::SHA3.new.hexdigest(''), empty_string_sha3
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.0.1
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/