crc 0.4 → 0.4.0.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 77aec27c0554b78347e7fae144088b66cc038a06
4
- data.tar.gz: a670a4d32e830857f1f52eca35c55dce4f9daec4
3
+ metadata.gz: 69461cc84e80b500fcae459c0b4ce19d99bdb92f
4
+ data.tar.gz: 13212d4202a2f3ac678c6e6345226fc3220e391b
5
5
  SHA512:
6
- metadata.gz: e9106bd5897d640ac339e07d9ae750a6102c6dad97a5e0c7c23e946ec249a600c6c4a1f56df54bd0806ab98d47155ebeb0bb8965a31d467d60ebc687755d5cbe
7
- data.tar.gz: db773998a7c2e3542ea30faf93b38628959a4376d8899dca2640a77aae39695b2f5efb8de283e1fce3cf8a1cfd1adb1b57830a5f59c096994984da06514263db
6
+ metadata.gz: 542043f97a8cb06d3afa1487fc7169ccb1d4db5dd6cb0674e76c6548f7fcdac35108a3cbf177f9e19e41286438f20d9c2f7fdd0e646a12a36aac243cbc101567
7
+ data.tar.gz: fbaf27266779e6da9b536ae65e3e07c8775bfbd9ea91ad515e831ec29417a92060b7db293229d963643f4e5ad411916fd91f95bb2fa0fabab3a77c2736018f4b
@@ -2,7 +2,12 @@ This document is written in Japanese.
2
2
 
3
3
  # crc for ruby の更新履歴
4
4
 
5
- ## crc-0.4 (TRYOUT)
5
+ ## crc-0.4.0.1 (平成29年3月28日 火曜日)
6
+
7
+ * acrc、shift 系メソッドのバグ修正
8
+
9
+
10
+ ## crc-0.4 (平成29年3月5日 日曜日)
6
11
 
7
12
  ***互換性を損なう変更があります。***
8
13
 
data/README.md CHANGED
@@ -20,7 +20,7 @@ If you need more speed, please use with [crc-turbo](https://rubygems/gems/crc-tu
20
20
  * author: dearblue (mailto:dearblue@users.noreply.github.com)
21
21
  * report issue to: <https://github.com/dearblue/ruby-crc/issues>
22
22
  * how to install: ``gem install crc``
23
- * version: 0.4
23
+ * version: 0.4.0.1
24
24
  * production quality: TECHNICAL PREVIEW
25
25
  * licensing:
26
26
  * ***BSD-2-Clause : MAIN LICENSE***
data/gemstub.rb CHANGED
@@ -15,13 +15,13 @@ Pure ruby implemented general CRC (Cyclic Redundancy Check) calcurator.
15
15
  Customization is posible for 1 to 64 bit width, any polynomials, and with/without bit reflection input/output.
16
16
  If you need more speed, please use crc-turbo.
17
17
  EOS
18
- s.homepage = "https://github.com/dearblue/ruby-crc-turbo"
18
+ s.homepage = "https://github.com/dearblue/ruby-crc"
19
19
  s.licenses = ["BSD-2-Clause", "Zlib", "CC0-1.0"]
20
20
  s.author = "dearblue"
21
21
  s.email = "dearblue@users.noreply.github.com"
22
22
 
23
23
  s.required_ruby_version = ">= 2.2"
24
- s.add_development_dependency "rake"
24
+ s.add_development_dependency "rake", ">= 12"
25
25
  end
26
26
 
27
27
  verfile = "lib/crc/version.rb"
@@ -37,6 +37,16 @@ class CRC
37
37
  end
38
38
  end
39
39
 
40
+ refine NilClass do
41
+ def each_byte
42
+ self
43
+ end
44
+
45
+ def reverse_each_byte
46
+ nil
47
+ end
48
+ end
49
+
40
50
  # refinements:
41
51
  # * convert_internal_state_for
42
52
  # * convert_target_state_for
@@ -1,4 +1,8 @@
1
+ require_relative "_extensions"
2
+
1
3
  class CRC
4
+ using Extensions
5
+
2
6
  module Calcurator
3
7
  #
4
8
  # call-seq:
@@ -1,5 +1,5 @@
1
1
  #!ruby
2
2
 
3
3
  class CRC
4
- VERSION = "0.4"
4
+ VERSION = "0.4.0.1"
5
5
  end
@@ -0,0 +1,23 @@
1
+ #!ruby
2
+
3
+ require "test-unit"
4
+ require_relative "common"
5
+ require "crc"
6
+ require "crc/acrc"
7
+ require "securerandom"
8
+
9
+ class TestArcCRC < Test::Unit::TestCase
10
+ $testmodules.each do |crc|
11
+ class_eval(<<-"EOS", __FILE__, __LINE__ + 1)
12
+ def test_arc_#{crc.to_s.slice(/\w+$/)}
13
+ crc = #{crc}
14
+ [["", "", 12345],
15
+ ["123456789", nil, 1234567],
16
+ ["", "123456789", 123456789]].each do |a, b, t|
17
+ t &= crc.bitmask
18
+ assert_equal(t, crc.crc(a + crc.acrc(a, b, t) + (b || "")))
19
+ end
20
+ end
21
+ EOS
22
+ end
23
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crc
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.4'
4
+ version: 0.4.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - dearblue
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-05 00:00:00.000000000 Z
11
+ date: 2017-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '12'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '12'
27
27
  description: |
28
28
  Pure ruby implemented general CRC (Cyclic Redundancy Check) calcurator.
29
29
  Customization is posible for 1 to 64 bit width, any polynomials, and with/without bit reflection input/output.
@@ -74,9 +74,10 @@ files:
74
74
  - lib/crc/version.rb
75
75
  - test/common.rb
76
76
  - test/self_check.rb
77
+ - test/test_arc.rb
77
78
  - test/test_block.rb
78
79
  - test/test_magic.rb
79
- homepage: https://github.com/dearblue/ruby-crc-turbo
80
+ homepage: https://github.com/dearblue/ruby-crc
80
81
  licenses:
81
82
  - BSD-2-Clause
82
83
  - Zlib
@@ -102,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
102
103
  version: '0'
103
104
  requirements: []
104
105
  rubyforge_project:
105
- rubygems_version: 2.6.10
106
+ rubygems_version: 2.6.11
106
107
  signing_key:
107
108
  specification_version: 4
108
109
  summary: general CRC calcurator