precompiled-digest-crc 0.7.0
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 +7 -0
- data/.github/workflows/cibuildgem.yaml +89 -0
- data/.github/workflows/integration.yml +26 -0
- data/.github/workflows/ruby.yml +33 -0
- data/.gitignore +11 -0
- data/.rspec +1 -0
- data/.yardopts +1 -0
- data/ChangeLog.md +212 -0
- data/Gemfile +16 -0
- data/LICENSE.txt +20 -0
- data/README.md +401 -0
- data/Rakefile +57 -0
- data/benchmarks.rb +59 -0
- data/digest-crc.gemspec +65 -0
- data/ext/digest/Rakefile +46 -0
- data/ext/digest/compat/ruby.h +11 -0
- data/ext/digest/crc12_3gpp/crc12_3gpp.c +68 -0
- data/ext/digest/crc12_3gpp/crc12_3gpp.h +11 -0
- data/ext/digest/crc12_3gpp/crc12_3gpp_ext.c +32 -0
- data/ext/digest/crc12_3gpp/extconf.rb +7 -0
- data/ext/digest/crc15/crc15.c +54 -0
- data/ext/digest/crc15/crc15.h +11 -0
- data/ext/digest/crc15/crc15_ext.c +33 -0
- data/ext/digest/crc15/extconf.rb +7 -0
- data/ext/digest/crc16/crc16.c +70 -0
- data/ext/digest/crc16/crc16.h +11 -0
- data/ext/digest/crc16/crc16_ext.c +33 -0
- data/ext/digest/crc16/extconf.rb +7 -0
- data/ext/digest/crc16_ccitt/crc16_ccitt.c +70 -0
- data/ext/digest/crc16_ccitt/crc16_ccitt.h +8 -0
- data/ext/digest/crc16_ccitt/crc16_ccitt_ext.c +33 -0
- data/ext/digest/crc16_ccitt/extconf.rb +7 -0
- data/ext/digest/crc16_dnp/crc16_dnp.c +54 -0
- data/ext/digest/crc16_dnp/crc16_dnp.h +8 -0
- data/ext/digest/crc16_dnp/crc16_dnp_ext.c +33 -0
- data/ext/digest/crc16_dnp/extconf.rb +7 -0
- data/ext/digest/crc16_genibus/crc16_genibus.c +70 -0
- data/ext/digest/crc16_genibus/crc16_genibus.h +8 -0
- data/ext/digest/crc16_genibus/crc16_genibus_ext.c +33 -0
- data/ext/digest/crc16_genibus/extconf.rb +7 -0
- data/ext/digest/crc16_kermit/crc16_kermit.c +70 -0
- data/ext/digest/crc16_kermit/crc16_kermit.h +8 -0
- data/ext/digest/crc16_kermit/crc16_kermit_ext.c +33 -0
- data/ext/digest/crc16_kermit/extconf.rb +7 -0
- data/ext/digest/crc16_modbus/crc16_modbus.c +70 -0
- data/ext/digest/crc16_modbus/crc16_modbus.h +8 -0
- data/ext/digest/crc16_modbus/crc16_modbus_ext.c +32 -0
- data/ext/digest/crc16_modbus/extconf.rb +7 -0
- data/ext/digest/crc16_usb/crc16_usb.c +70 -0
- data/ext/digest/crc16_usb/crc16_usb.h +8 -0
- data/ext/digest/crc16_usb/crc16_usb_ext.c +32 -0
- data/ext/digest/crc16_usb/extconf.rb +7 -0
- data/ext/digest/crc16_x_25/crc16_x_25.c +70 -0
- data/ext/digest/crc16_x_25/crc16_x_25.h +8 -0
- data/ext/digest/crc16_x_25/crc16_x_25_ext.c +32 -0
- data/ext/digest/crc16_x_25/extconf.rb +7 -0
- data/ext/digest/crc16_xmodem/crc16_xmodem.c +70 -0
- data/ext/digest/crc16_xmodem/crc16_xmodem.h +8 -0
- data/ext/digest/crc16_xmodem/crc16_xmodem_ext.c +33 -0
- data/ext/digest/crc16_xmodem/extconf.rb +7 -0
- data/ext/digest/crc16_zmodem/crc16_zmodem.c +70 -0
- data/ext/digest/crc16_zmodem/crc16_zmodem.h +8 -0
- data/ext/digest/crc16_zmodem/crc16_zmodem_ext.c +33 -0
- data/ext/digest/crc16_zmodem/extconf.rb +7 -0
- data/ext/digest/crc24/crc24.c +70 -0
- data/ext/digest/crc24/crc24.h +11 -0
- data/ext/digest/crc24/crc24_ext.c +32 -0
- data/ext/digest/crc24/extconf.rb +7 -0
- data/ext/digest/crc32/crc32.c +69 -0
- data/ext/digest/crc32/crc32.h +11 -0
- data/ext/digest/crc32/crc32_ext.c +32 -0
- data/ext/digest/crc32/extconf.rb +7 -0
- data/ext/digest/crc32_bzip2/crc32_bzip2.c +70 -0
- data/ext/digest/crc32_bzip2/crc32_bzip2.h +8 -0
- data/ext/digest/crc32_bzip2/crc32_bzip2_ext.c +32 -0
- data/ext/digest/crc32_bzip2/extconf.rb +7 -0
- data/ext/digest/crc32_jam/crc32_jam.c +70 -0
- data/ext/digest/crc32_jam/crc32_jam.h +8 -0
- data/ext/digest/crc32_jam/crc32_jam_ext.c +31 -0
- data/ext/digest/crc32_jam/extconf.rb +7 -0
- data/ext/digest/crc32_mpeg/crc32_mpeg.c +70 -0
- data/ext/digest/crc32_mpeg/crc32_mpeg.h +8 -0
- data/ext/digest/crc32_mpeg/crc32_mpeg_ext.c +32 -0
- data/ext/digest/crc32_mpeg/extconf.rb +7 -0
- data/ext/digest/crc32_posix/crc32_posix.c +70 -0
- data/ext/digest/crc32_posix/crc32_posix.h +8 -0
- data/ext/digest/crc32_posix/crc32_posix_ext.c +32 -0
- data/ext/digest/crc32_posix/extconf.rb +7 -0
- data/ext/digest/crc32_xfer/crc32_xfer.c +70 -0
- data/ext/digest/crc32_xfer/crc32_xfer.h +8 -0
- data/ext/digest/crc32_xfer/crc32_xfer_ext.c +32 -0
- data/ext/digest/crc32_xfer/extconf.rb +7 -0
- data/ext/digest/crc32c/crc32c.c +70 -0
- data/ext/digest/crc32c/crc32c.h +8 -0
- data/ext/digest/crc32c/crc32c_ext.c +31 -0
- data/ext/digest/crc32c/extconf.rb +7 -0
- data/ext/digest/crc5/crc5.c +54 -0
- data/ext/digest/crc5/crc5.h +11 -0
- data/ext/digest/crc5/crc5_ext.c +32 -0
- data/ext/digest/crc5/extconf.rb +7 -0
- data/ext/digest/crc64/crc64.c +102 -0
- data/ext/digest/crc64/crc64.h +11 -0
- data/ext/digest/crc64/crc64_ext.c +32 -0
- data/ext/digest/crc64/extconf.rb +7 -0
- data/ext/digest/crc64_jones/crc64_jones.c +102 -0
- data/ext/digest/crc64_jones/crc64_jones.h +8 -0
- data/ext/digest/crc64_jones/crc64_jones_ext.c +31 -0
- data/ext/digest/crc64_jones/extconf.rb +7 -0
- data/ext/digest/crc64_nvme/crc64_nvme.c +102 -0
- data/ext/digest/crc64_nvme/crc64_nvme.h +8 -0
- data/ext/digest/crc64_nvme/crc64_nvme_ext.c +31 -0
- data/ext/digest/crc64_nvme/extconf.rb +7 -0
- data/ext/digest/crc64_xz/crc64_xz.c +102 -0
- data/ext/digest/crc64_xz/crc64_xz.h +8 -0
- data/ext/digest/crc64_xz/crc64_xz_ext.c +31 -0
- data/ext/digest/crc64_xz/extconf.rb +7 -0
- data/ext/digest/crc8/crc8.c +54 -0
- data/ext/digest/crc8/crc8.h +11 -0
- data/ext/digest/crc8/crc8_ext.c +32 -0
- data/ext/digest/crc8/extconf.rb +7 -0
- data/ext/digest/crc8_1wire/crc8_1wire.c +54 -0
- data/ext/digest/crc8_1wire/crc8_1wire.h +8 -0
- data/ext/digest/crc8_1wire/crc8_1wire_ext.c +31 -0
- data/ext/digest/crc8_1wire/extconf.rb +7 -0
- data/gemspec.yml +25 -0
- data/lib/digest/crc.rb +211 -0
- data/lib/digest/crc1.rb +37 -0
- data/lib/digest/crc15.rb +45 -0
- data/lib/digest/crc16.rb +61 -0
- data/lib/digest/crc16_ccitt.rb +59 -0
- data/lib/digest/crc16_dnp.rb +62 -0
- data/lib/digest/crc16_genibus.rb +65 -0
- data/lib/digest/crc16_kermit.rb +59 -0
- data/lib/digest/crc16_modbus.rb +57 -0
- data/lib/digest/crc16_qt.rb +11 -0
- data/lib/digest/crc16_usb.rb +23 -0
- data/lib/digest/crc16_x_25.rb +63 -0
- data/lib/digest/crc16_xmodem.rb +57 -0
- data/lib/digest/crc16_zmodem.rb +57 -0
- data/lib/digest/crc24.rb +61 -0
- data/lib/digest/crc32.rb +95 -0
- data/lib/digest/crc32_bzip2.rb +57 -0
- data/lib/digest/crc32_jam.rb +16 -0
- data/lib/digest/crc32_mpeg.rb +94 -0
- data/lib/digest/crc32_posix.rb +58 -0
- data/lib/digest/crc32_xfer.rb +61 -0
- data/lib/digest/crc32c.rb +87 -0
- data/lib/digest/crc5.rb +58 -0
- data/lib/digest/crc64.rb +95 -0
- data/lib/digest/crc64_jones.rb +93 -0
- data/lib/digest/crc64_nvme.rb +95 -0
- data/lib/digest/crc64_xz.rb +95 -0
- data/lib/digest/crc8.rb +45 -0
- data/lib/digest/crc8_1wire.rb +42 -0
- metadata +265 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: b24420042b43eaf2eb6c1251894a36a945eb4c1492ec33be8d89a422318b9a49
|
|
4
|
+
data.tar.gz: c70f5ecc05dc3164c9487a5c862f52520a7c9e0fff7541b55c1f5f5765c4e63f
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 7c9161df8167552a08d9de1717601a98ef7ca1fc277c170c6813212371a24b47c2c0c2350114a3fefadc4127c866c798cb6543b6c3163b6e33bffe1caa58950e
|
|
7
|
+
data.tar.gz: c6af59e5fa29eb8f87c1a87f9be607d1b4890a6f90f76e15d04474116fc966fd7be9a2c441200c0b0b18b4e929f25463c41fbfc7bb87a9a457b75c082c747f30
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
name: "Package and release gems with precompiled binaries"
|
|
2
|
+
on:
|
|
3
|
+
workflow_dispatch:
|
|
4
|
+
inputs:
|
|
5
|
+
release:
|
|
6
|
+
description: "If the whole build passes on all platforms, release the gems on RubyGems.org"
|
|
7
|
+
required: false
|
|
8
|
+
type: boolean
|
|
9
|
+
default: false
|
|
10
|
+
jobs:
|
|
11
|
+
compile:
|
|
12
|
+
timeout-minutes: 20
|
|
13
|
+
name: "Cross compile the gem on different ruby versions"
|
|
14
|
+
env:
|
|
15
|
+
RUBY_CC_VERSION: "4.0.0:3.4.6:3.3.8"
|
|
16
|
+
strategy:
|
|
17
|
+
matrix:
|
|
18
|
+
os: ["macos-latest", "ubuntu-22.04"]
|
|
19
|
+
runs-on: "${{ matrix.os }}"
|
|
20
|
+
steps:
|
|
21
|
+
- name: "Checkout code"
|
|
22
|
+
uses: "actions/checkout@v5"
|
|
23
|
+
- name: "Setup Ruby"
|
|
24
|
+
uses: "ruby/setup-ruby@v1"
|
|
25
|
+
with:
|
|
26
|
+
ruby-version: "3.1.7"
|
|
27
|
+
bundler-cache: true
|
|
28
|
+
- name: "Run cibuildgem"
|
|
29
|
+
uses: "shopify/cibuildgem/.github/actions/cibuildgem@main"
|
|
30
|
+
with:
|
|
31
|
+
step: "compile"
|
|
32
|
+
test:
|
|
33
|
+
timeout-minutes: 20
|
|
34
|
+
name: "Run the test suite"
|
|
35
|
+
needs: compile
|
|
36
|
+
strategy:
|
|
37
|
+
matrix:
|
|
38
|
+
os: ["macos-latest"]
|
|
39
|
+
rubies: ["4.0"]
|
|
40
|
+
type: ["cross"]
|
|
41
|
+
runs-on: "${{ matrix.os }}"
|
|
42
|
+
steps:
|
|
43
|
+
- name: "Checkout code"
|
|
44
|
+
uses: "actions/checkout@v5"
|
|
45
|
+
- name: "Setup Ruby"
|
|
46
|
+
uses: "ruby/setup-ruby@v1"
|
|
47
|
+
with:
|
|
48
|
+
ruby-version: "${{ matrix.rubies }}"
|
|
49
|
+
bundler-cache: true
|
|
50
|
+
- name: "Run cibuildgem"
|
|
51
|
+
uses: "shopify/cibuildgem/.github/actions/cibuildgem@main"
|
|
52
|
+
with:
|
|
53
|
+
step: "test_${{ matrix.type }}"
|
|
54
|
+
install:
|
|
55
|
+
timeout-minutes: 5
|
|
56
|
+
name: "Verify the gem can be installed"
|
|
57
|
+
needs: test
|
|
58
|
+
strategy:
|
|
59
|
+
matrix:
|
|
60
|
+
os: ["macos-latest", "ubuntu-22.04"]
|
|
61
|
+
runs-on: "${{ matrix.os }}"
|
|
62
|
+
steps:
|
|
63
|
+
- name: "Setup Ruby"
|
|
64
|
+
uses: "ruby/setup-ruby@v1"
|
|
65
|
+
with:
|
|
66
|
+
ruby-version: "4.0.0"
|
|
67
|
+
- name: "Run cibuildgem"
|
|
68
|
+
uses: "shopify/cibuildgem/.github/actions/cibuildgem@main"
|
|
69
|
+
with:
|
|
70
|
+
step: "install"
|
|
71
|
+
release:
|
|
72
|
+
environment: release
|
|
73
|
+
permissions:
|
|
74
|
+
id-token: write
|
|
75
|
+
contents: read
|
|
76
|
+
timeout-minutes: 5
|
|
77
|
+
if: ${{ inputs.release }}
|
|
78
|
+
name: "Release all gems with RubyGems"
|
|
79
|
+
needs: install
|
|
80
|
+
runs-on: "ubuntu-latest"
|
|
81
|
+
steps:
|
|
82
|
+
- name: "Setup Ruby"
|
|
83
|
+
uses: "ruby/setup-ruby@v1"
|
|
84
|
+
with:
|
|
85
|
+
ruby-version: "4.0.0"
|
|
86
|
+
- name: "Run cibuildgem"
|
|
87
|
+
uses: "shopify/cibuildgem/.github/actions/cibuildgem@main"
|
|
88
|
+
with:
|
|
89
|
+
step: "release"
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags: [ 'v0.*' ]
|
|
6
|
+
pull_request:
|
|
7
|
+
paths: [ 'ext/**' ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
tests:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
fail-fast: false
|
|
14
|
+
name: Integration Testing
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
- name: Set up Docker
|
|
18
|
+
uses: docker-practice/actions-setup-docker@master
|
|
19
|
+
- name: Set up Ruby
|
|
20
|
+
uses: ruby/setup-ruby@v1
|
|
21
|
+
with:
|
|
22
|
+
ruby-version: 3.2
|
|
23
|
+
- name: Install dependencies
|
|
24
|
+
run: bundle install --jobs 4 --retry 3
|
|
25
|
+
- name: Run integration tests
|
|
26
|
+
run: bundle exec rake spec:integration
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on: [ push, pull_request ]
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
tests:
|
|
7
|
+
runs-on: ${{ matrix.os }}
|
|
8
|
+
strategy:
|
|
9
|
+
fail-fast: false
|
|
10
|
+
matrix:
|
|
11
|
+
os:
|
|
12
|
+
- ubuntu-latest
|
|
13
|
+
- macos-latest
|
|
14
|
+
ruby:
|
|
15
|
+
- '3.0'
|
|
16
|
+
- '3.1'
|
|
17
|
+
- '3.2'
|
|
18
|
+
- '3.3'
|
|
19
|
+
- '3.4'
|
|
20
|
+
- '4.0'
|
|
21
|
+
- jruby
|
|
22
|
+
- truffleruby
|
|
23
|
+
name: OS ${{ matrix.os }} / Ruby ${{ matrix.ruby }}
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@v4
|
|
26
|
+
- name: Set up Ruby
|
|
27
|
+
uses: ruby/setup-ruby@v1
|
|
28
|
+
with:
|
|
29
|
+
ruby-version: ${{ matrix.ruby }}
|
|
30
|
+
- name: Install dependencies
|
|
31
|
+
run: bundle install --jobs 4 --retry 3
|
|
32
|
+
- name: Run tests
|
|
33
|
+
run: bundle exec rake spec
|
data/.gitignore
ADDED
data/.rspec
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
--colour --format documentation
|
data/.yardopts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
--markup markdown --title 'Digest CRC Documentation' --protected --files ChangeLog.md,LICENSE.txt
|
data/ChangeLog.md
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
### 0.7.0 / 2025-01-28
|
|
2
|
+
|
|
3
|
+
* Added {Digest::CRC64NVMe}.
|
|
4
|
+
* Added {Digest::CRC.implementation}.
|
|
5
|
+
* Reduced duplicate code.
|
|
6
|
+
|
|
7
|
+
### 0.6.5 / 2023-07-03
|
|
8
|
+
|
|
9
|
+
* Corrected the implementation of {Digest::CRC5}.
|
|
10
|
+
* Make `digest-crc` Ractor-safe.
|
|
11
|
+
|
|
12
|
+
### 0.6.4 / 2021-07-14
|
|
13
|
+
|
|
14
|
+
* Silence potential method redefinition warnings when loading the C extensions.
|
|
15
|
+
(@ojab)
|
|
16
|
+
|
|
17
|
+
### 0.6.3 / 2020-12-19
|
|
18
|
+
|
|
19
|
+
* Broaden rake dependency to >= 12.0.0, < 14.0.0` for ruby 2.7, which includes
|
|
20
|
+
rake 13.x.
|
|
21
|
+
|
|
22
|
+
### 0.6.2 / 2020-12-03
|
|
23
|
+
|
|
24
|
+
* Lower the rake dependency to `~> 12.0` for ruby 2.6.
|
|
25
|
+
* Fixed a bug in `ext/digest/Rakefile` which prevented digest-crc from being
|
|
26
|
+
installed on systems where C extensions could not be successfully compiled.
|
|
27
|
+
* Rake's `ruby` method, which in turn calls rake's `sh` method, raises
|
|
28
|
+
a `RuntimeError` exception when the ruby command fails, causing rake to
|
|
29
|
+
exit with an error code. Instead, rescue any `RuntimeError` exceptions and
|
|
30
|
+
fail gracefully.
|
|
31
|
+
|
|
32
|
+
### 0.6.1 / 2020-07-02
|
|
33
|
+
|
|
34
|
+
* Fix installation issues under bundler by adding rake as an explicit dependency
|
|
35
|
+
(@rogerluan).
|
|
36
|
+
|
|
37
|
+
### 0.6.0 / 2020-07-01
|
|
38
|
+
|
|
39
|
+
* Implement _optional_ C extensions for all CRC algorithms, resulting in an
|
|
40
|
+
average performance improvement of ~40x. Note, if for whatever reason the
|
|
41
|
+
C extensions cannot be compiled, they will be skipped and the pure-Ruby
|
|
42
|
+
CRC algorithms will be used instead. If the C extensions were successfully
|
|
43
|
+
compiled, then they will be loaded and override the pure-Ruby CRC methods with
|
|
44
|
+
the C equivalents.
|
|
45
|
+
* Alias {Digest::CRC16QT} to {Digest::CRC16X25}, since they are effectively the same (@dearblue).
|
|
46
|
+
* Fix {Digest::CRC32::WIDTH} (@dearblue).
|
|
47
|
+
|
|
48
|
+
#### pure-Ruby (ruby 2.7.1)
|
|
49
|
+
|
|
50
|
+
Loading Digest::CRC classes ...
|
|
51
|
+
Generating 1000 8Kb lengthed strings ...
|
|
52
|
+
Benchmarking Digest::CRC classes ...
|
|
53
|
+
user system total real
|
|
54
|
+
Digest::CRC1#update 0.412953 0.000000 0.412953 ( 0.414688)
|
|
55
|
+
Digest::CRC5#update 1.116375 0.000003 1.116378 ( 1.120741)
|
|
56
|
+
Digest::CRC8#update 0.994263 0.000013 0.994276 ( 1.001079)
|
|
57
|
+
Digest::CRC8_1Wire#update 0.974115 0.000004 0.974119 ( 0.978186)
|
|
58
|
+
Digest::CRC15#update 1.139402 0.000927 1.140329 ( 1.146608)
|
|
59
|
+
Digest::CRC16#update 0.967836 0.000000 0.967836 ( 0.971792)
|
|
60
|
+
Digest::CRC16CCITT#update 1.118851 0.000000 1.118851 ( 1.123217)
|
|
61
|
+
Digest::CRC16DNP#update 0.922211 0.000000 0.922211 ( 0.925739)
|
|
62
|
+
Digest::CRC16Genibus#update 1.120580 0.000000 1.120580 ( 1.124771)
|
|
63
|
+
Digest::CRC16Modbus#update 0.955612 0.000000 0.955612 ( 0.959463)
|
|
64
|
+
Digest::CRC16QT#update 8.153403 0.000012 8.153415 ( 8.189977)
|
|
65
|
+
Digest::CRC16USB#update 0.952557 0.000000 0.952557 ( 0.956145)
|
|
66
|
+
Digest::CRC16X25#update 0.962295 0.000000 0.962295 ( 0.970401)
|
|
67
|
+
Digest::CRC16XModem#update 1.120531 0.000000 1.120531 ( 1.124494)
|
|
68
|
+
Digest::CRC16ZModem#update 1.124226 0.000000 1.124226 ( 1.128632)
|
|
69
|
+
Digest::CRC24#update 1.126317 0.000000 1.126317 ( 1.130794)
|
|
70
|
+
Digest::CRC32#update 0.960015 0.000000 0.960015 ( 0.964803)
|
|
71
|
+
Digest::CRC32BZip2#update 1.128626 0.000000 1.128626 ( 1.133641)
|
|
72
|
+
Digest::CRC32c#update 0.964047 0.000000 0.964047 ( 0.967456)
|
|
73
|
+
Digest::CRC32Jam#update 0.959141 0.000972 0.960113 ( 0.967444)
|
|
74
|
+
Digest::CRC32MPEG#update 1.131119 0.000002 1.131121 ( 1.137440)
|
|
75
|
+
Digest::CRC32POSIX#update 1.126019 0.000000 1.126019 ( 1.130549)
|
|
76
|
+
Digest::CRC32XFER#update 1.116598 0.000000 1.116598 ( 1.120595)
|
|
77
|
+
Digest::CRC64#update 2.665880 0.000928 2.666808 ( 2.680942)
|
|
78
|
+
Digest::CRC64Jones#update 2.678003 0.000000 2.678003 ( 2.691390)
|
|
79
|
+
Digest::CRC64XZ#update 2.671395 0.000000 2.671395 ( 2.682684)
|
|
80
|
+
|
|
81
|
+
#### pure-Ruby (jruby 9.2.11.1)
|
|
82
|
+
|
|
83
|
+
Loading Digest::CRC classes ...
|
|
84
|
+
Generating 1000 8Kb lengthed strings ...
|
|
85
|
+
Benchmarking Digest::CRC classes ...
|
|
86
|
+
user system total real
|
|
87
|
+
Digest::CRC1#update 0.700000 0.070000 0.770000 ( 0.436112)
|
|
88
|
+
Digest::CRC5#update 1.930000 0.050000 1.980000 ( 1.084749)
|
|
89
|
+
Digest::CRC8#update 1.510000 0.060000 1.570000 ( 0.979123)
|
|
90
|
+
Digest::CRC8_1Wire#update 0.730000 0.030000 0.760000 ( 0.761309)
|
|
91
|
+
Digest::CRC15#update 1.760000 0.080000 1.840000 ( 1.061413)
|
|
92
|
+
Digest::CRC16#update 1.560000 0.030000 1.590000 ( 0.951273)
|
|
93
|
+
Digest::CRC16CCITT#update 1.700000 0.010000 1.710000 ( 1.046854)
|
|
94
|
+
Digest::CRC16DNP#update 1.490000 0.000000 1.490000 ( 0.902434)
|
|
95
|
+
Digest::CRC16Genibus#update 1.820000 0.020000 1.840000 ( 1.030269)
|
|
96
|
+
Digest::CRC16Modbus#update 0.740000 0.010000 0.750000 ( 0.738604)
|
|
97
|
+
Digest::CRC16QT#update 7.280000 0.040000 7.320000 ( 6.399987)
|
|
98
|
+
Digest::CRC16USB#update 0.930000 0.000000 0.930000 ( 0.801541)
|
|
99
|
+
Digest::CRC16X25#update 0.870000 0.000000 0.870000 ( 0.805130)
|
|
100
|
+
Digest::CRC16XModem#update 1.320000 0.010000 1.330000 ( 0.968956)
|
|
101
|
+
Digest::CRC16ZModem#update 1.300000 0.010000 1.310000 ( 0.928303)
|
|
102
|
+
Digest::CRC24#update 1.550000 0.020000 1.570000 ( 1.024450)
|
|
103
|
+
Digest::CRC32#update 1.260000 0.000000 1.260000 ( 0.913814)
|
|
104
|
+
Digest::CRC32BZip2#update 1.210000 0.010000 1.220000 ( 0.919086)
|
|
105
|
+
Digest::CRC32c#update 0.770000 0.010000 0.780000 ( 0.761726)
|
|
106
|
+
Digest::CRC32Jam#update 0.930000 0.000000 0.930000 ( 0.800468)
|
|
107
|
+
Digest::CRC32MPEG#update 1.240000 0.010000 1.250000 ( 0.933962)
|
|
108
|
+
Digest::CRC32POSIX#update 1.290000 0.010000 1.300000 ( 0.925254)
|
|
109
|
+
Digest::CRC32XFER#update 1.270000 0.000000 1.270000 ( 0.920521)
|
|
110
|
+
Digest::CRC64#update 3.480000 0.020000 3.500000 ( 2.883794)
|
|
111
|
+
Digest::CRC64Jones#update 2.740000 0.000000 2.740000 ( 2.738251)
|
|
112
|
+
Digest::CRC64XZ#update 2.780000 0.010000 2.790000 ( 2.715833)
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
#### C extensions (ruby 2.7.1)
|
|
116
|
+
|
|
117
|
+
Loading Digest::CRC classes ...
|
|
118
|
+
Generating 1000 8Kb lengthed strings ...
|
|
119
|
+
Benchmarking Digest::CRC classes ...
|
|
120
|
+
user system total real
|
|
121
|
+
Digest::CRC1#update 0.407438 0.000000 0.407438 ( 0.410495)
|
|
122
|
+
Digest::CRC5#update 0.022873 0.000000 0.022873 ( 0.023796)
|
|
123
|
+
Digest::CRC8#update 0.020129 0.000000 0.020129 ( 0.020887)
|
|
124
|
+
Digest::CRC8_1Wire#update 0.020106 0.000000 0.020106 ( 0.020897)
|
|
125
|
+
Digest::CRC15#update 0.028765 0.000003 0.028768 ( 0.029549)
|
|
126
|
+
Digest::CRC16#update 0.022176 0.000856 0.023032 ( 0.023153)
|
|
127
|
+
Digest::CRC16CCITT#update 0.028570 0.000000 0.028570 ( 0.028691)
|
|
128
|
+
Digest::CRC16DNP#update 0.023240 0.000001 0.023241 ( 0.024008)
|
|
129
|
+
Digest::CRC16Genibus#update 0.028692 0.000000 0.028692 ( 0.029575)
|
|
130
|
+
Digest::CRC16Modbus#update 0.023928 0.000000 0.023928 ( 0.024859)
|
|
131
|
+
Digest::CRC16QT#update 7.965822 0.000968 7.966790 ( 8.001781)
|
|
132
|
+
Digest::CRC16USB#update 0.023448 0.000001 0.023449 ( 0.024420)
|
|
133
|
+
Digest::CRC16X25#update 0.023061 0.000000 0.023061 ( 0.023861)
|
|
134
|
+
Digest::CRC16XModem#update 0.029407 0.000000 0.029407 ( 0.030583)
|
|
135
|
+
Digest::CRC16ZModem#update 0.029522 0.000000 0.029522 ( 0.030438)
|
|
136
|
+
Digest::CRC24#update 0.029528 0.000000 0.029528 ( 0.030504)
|
|
137
|
+
Digest::CRC32#update 0.023306 0.000000 0.023306 ( 0.024278)
|
|
138
|
+
Digest::CRC32BZip2#update 0.026346 0.000000 0.026346 ( 0.027293)
|
|
139
|
+
Digest::CRC32c#update 0.023525 0.000000 0.023525 ( 0.024489)
|
|
140
|
+
Digest::CRC32Jam#update 0.023348 0.000000 0.023348 ( 0.023477)
|
|
141
|
+
Digest::CRC32MPEG#update 0.026287 0.000000 0.026287 ( 0.027394)
|
|
142
|
+
Digest::CRC32POSIX#update 0.026063 0.000000 0.026063 ( 0.026986)
|
|
143
|
+
Digest::CRC32XFER#update 0.026374 0.000000 0.026374 ( 0.027314)
|
|
144
|
+
Digest::CRC64#update 0.023523 0.000000 0.023523 ( 0.024484)
|
|
145
|
+
Digest::CRC64Jones#update 0.023479 0.000000 0.023479 ( 0.024432)
|
|
146
|
+
Digest::CRC64XZ#update 0.024146 0.000000 0.024146 ( 0.025129)
|
|
147
|
+
|
|
148
|
+
### 0.5.1 / 2020-03-03
|
|
149
|
+
|
|
150
|
+
* Fixed XOR logic in {Digest::CRC16Genibus}.
|
|
151
|
+
* Freeze all `TABLE` constants.
|
|
152
|
+
* Added missing documentation.
|
|
153
|
+
|
|
154
|
+
### 0.5.0 / 2020-03-01
|
|
155
|
+
|
|
156
|
+
* Added {Digest::CRC15}.
|
|
157
|
+
* Added {Digest::CRC16Genibus}.
|
|
158
|
+
* Added {Digest::CRC16Kermit}.
|
|
159
|
+
* Added {Digest::CRC16X25}.
|
|
160
|
+
* Added {Digest::CRC32BZip2}.
|
|
161
|
+
* Added {Digest::CRC32Jam}.
|
|
162
|
+
* Added {Digest::CRC32POSIX}.
|
|
163
|
+
* Added {Digest::CRC32XFER}.
|
|
164
|
+
* Added {Digest::CRC64Jones}.
|
|
165
|
+
* Added {Digest::CRC64XZ}.
|
|
166
|
+
* Renamed `Digest::CRC32Mpeg` to {Digest::CRC32MPEG}.
|
|
167
|
+
* Renamed `Digest::CRC81Wire` to {Digest::CRC8_1Wire}.
|
|
168
|
+
|
|
169
|
+
### 0.4.2 / 2020-03-01
|
|
170
|
+
|
|
171
|
+
* Corrected the logic in {Digest::CRC32#update}.
|
|
172
|
+
* Added missing {Digest::CRC5.pack} method.
|
|
173
|
+
* Fixed a require in `digest/crc8_1wire.rb`.
|
|
174
|
+
|
|
175
|
+
### 0.4.1 / 2014-04-16
|
|
176
|
+
|
|
177
|
+
* Allow Digest CRC classes to be extended and their constants overriden.
|
|
178
|
+
* Allow {Digest::CRC5::CRC_MASK} to be overriden by subclasses.
|
|
179
|
+
* {Digest::CRC81Wire} now inherites from {Digest::CRC8}.
|
|
180
|
+
|
|
181
|
+
### 0.4.0 / 2013-02-13
|
|
182
|
+
|
|
183
|
+
* Added {Digest::CRC16QT}.
|
|
184
|
+
|
|
185
|
+
### 0.3.0 / 2011-09-24
|
|
186
|
+
|
|
187
|
+
* Added {Digest::CRC81Wire} (Henry Garner).
|
|
188
|
+
|
|
189
|
+
### 0.2.0 / 2011-05-10
|
|
190
|
+
|
|
191
|
+
* Added {Digest::CRC32c}.
|
|
192
|
+
* Opted into [test.rubygems.org](http://test.rubygems.org/)
|
|
193
|
+
* Switched from using Jeweler and Bundler, to using
|
|
194
|
+
[Ore::Tasks](http://github.com/ruby-ore/ore-tasks).
|
|
195
|
+
|
|
196
|
+
### 0.1.0 / 2010-06-01
|
|
197
|
+
|
|
198
|
+
* Initial release.
|
|
199
|
+
* CRC1
|
|
200
|
+
* CRC5
|
|
201
|
+
* CRC8
|
|
202
|
+
* CRC16
|
|
203
|
+
* CRC16 CCITT
|
|
204
|
+
* CRC16 DNP
|
|
205
|
+
* CRC16 Modbus
|
|
206
|
+
* CRC16 USB
|
|
207
|
+
* CRC16 XModem
|
|
208
|
+
* CRC16 ZModem
|
|
209
|
+
* CRC24
|
|
210
|
+
* CRC32
|
|
211
|
+
* CRC32 Mpeg
|
|
212
|
+
* CRC64
|
data/Gemfile
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
source 'https://rubygems.org'
|
|
2
|
+
|
|
3
|
+
gemspec
|
|
4
|
+
|
|
5
|
+
group :development do
|
|
6
|
+
gem 'rake'
|
|
7
|
+
gem 'rubygems-tasks', '~> 0.2'
|
|
8
|
+
|
|
9
|
+
gem 'rspec', '~> 3.0'
|
|
10
|
+
gem 'simplecov', '~> 0.20'
|
|
11
|
+
|
|
12
|
+
gem 'yard', '~> 0.9'
|
|
13
|
+
gem 'kramdown'
|
|
14
|
+
gem 'kramdown-parser-gfm'
|
|
15
|
+
gem 'github-markup', '~> 1.1'
|
|
16
|
+
end
|
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Copyright (c) 2010-2025 Hal Brodigan
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
+
a copy of this software and associated documentation files (the
|
|
5
|
+
'Software'), to deal in the Software without restriction, including
|
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
+
the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be
|
|
12
|
+
included in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
17
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
18
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
19
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
20
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|