crc 0.4 → 0.4.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HISTORY.ja.md +6 -1
- data/README.md +1 -1
- data/gemstub.rb +2 -2
- data/lib/crc/_extensions.rb +10 -0
- data/lib/crc/_shift.rb +4 -0
- data/lib/crc/version.rb +1 -1
- data/test/test_arc.rb +23 -0
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69461cc84e80b500fcae459c0b4ce19d99bdb92f
|
4
|
+
data.tar.gz: 13212d4202a2f3ac678c6e6345226fc3220e391b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 542043f97a8cb06d3afa1487fc7169ccb1d4db5dd6cb0674e76c6548f7fcdac35108a3cbf177f9e19e41286438f20d9c2f7fdd0e646a12a36aac243cbc101567
|
7
|
+
data.tar.gz: fbaf27266779e6da9b536ae65e3e07c8775bfbd9ea91ad515e831ec29417a92060b7db293229d963643f4e5ad411916fd91f95bb2fa0fabab3a77c2736018f4b
|
data/HISTORY.ja.md
CHANGED
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
|
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"
|
data/lib/crc/_extensions.rb
CHANGED
data/lib/crc/_shift.rb
CHANGED
data/lib/crc/version.rb
CHANGED
data/test/test_arc.rb
ADDED
@@ -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:
|
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-
|
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: '
|
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: '
|
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
|
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.
|
106
|
+
rubygems_version: 2.6.11
|
106
107
|
signing_key:
|
107
108
|
specification_version: 4
|
108
109
|
summary: general CRC calcurator
|