digest-crc 0.6.0 → 0.6.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/integration.yml +26 -0
  3. data/.github/workflows/ruby.yml +31 -0
  4. data/.gitignore +1 -0
  5. data/ChangeLog.md +25 -1
  6. data/LICENSE.txt +1 -1
  7. data/README.md +304 -30
  8. data/Rakefile +15 -2
  9. data/benchmarks.rb +1 -1
  10. data/ext/digest/Rakefile +7 -12
  11. data/ext/digest/crc12_3gpp/crc12_3gpp.c +19 -17
  12. data/ext/digest/crc12_3gpp/crc12_3gpp_ext.c +1 -0
  13. data/ext/digest/crc15/crc15.c +10 -9
  14. data/ext/digest/crc15/crc15_ext.c +1 -0
  15. data/ext/digest/crc16/crc16.c +42 -41
  16. data/ext/digest/crc16/crc16_ext.c +1 -0
  17. data/ext/digest/crc16_ccitt/crc16_ccitt.c +42 -41
  18. data/ext/digest/crc16_ccitt/crc16_ccitt_ext.c +1 -0
  19. data/ext/digest/crc16_dnp/crc16_dnp.c +42 -41
  20. data/ext/digest/crc16_dnp/crc16_dnp_ext.c +1 -0
  21. data/ext/digest/crc16_genibus/crc16_genibus.c +42 -41
  22. data/ext/digest/crc16_genibus/crc16_genibus_ext.c +1 -0
  23. data/ext/digest/crc16_kermit/crc16_kermit.c +42 -41
  24. data/ext/digest/crc16_kermit/crc16_kermit_ext.c +1 -0
  25. data/ext/digest/crc16_modbus/crc16_modbus.c +42 -41
  26. data/ext/digest/crc16_modbus/crc16_modbus_ext.c +1 -0
  27. data/ext/digest/crc16_usb/crc16_usb.c +42 -41
  28. data/ext/digest/crc16_usb/crc16_usb_ext.c +1 -0
  29. data/ext/digest/crc16_x_25/crc16_x_25.c +42 -41
  30. data/ext/digest/crc16_x_25/crc16_x_25_ext.c +1 -0
  31. data/ext/digest/crc16_xmodem/crc16_xmodem.c +42 -41
  32. data/ext/digest/crc16_xmodem/crc16_xmodem_ext.c +1 -0
  33. data/ext/digest/crc16_zmodem/crc16_zmodem.c +42 -41
  34. data/ext/digest/crc16_zmodem/crc16_zmodem_ext.c +1 -0
  35. data/ext/digest/crc24/crc24.c +42 -41
  36. data/ext/digest/crc24/crc24_ext.c +1 -0
  37. data/ext/digest/crc32/crc32.c +42 -41
  38. data/ext/digest/crc32/crc32_ext.c +1 -0
  39. data/ext/digest/crc32_bzip2/crc32_bzip2.c +42 -41
  40. data/ext/digest/crc32_bzip2/crc32_bzip2_ext.c +1 -0
  41. data/ext/digest/crc32_jam/crc32_jam.c +42 -41
  42. data/ext/digest/crc32_jam/crc32_jam_ext.c +1 -0
  43. data/ext/digest/crc32_mpeg/crc32_mpeg.c +42 -41
  44. data/ext/digest/crc32_mpeg/crc32_mpeg_ext.c +1 -0
  45. data/ext/digest/crc32_posix/crc32_posix.c +42 -41
  46. data/ext/digest/crc32_posix/crc32_posix_ext.c +1 -0
  47. data/ext/digest/crc32_xfer/crc32_xfer.c +42 -41
  48. data/ext/digest/crc32_xfer/crc32_xfer_ext.c +1 -0
  49. data/ext/digest/crc32c/crc32c.c +42 -41
  50. data/ext/digest/crc32c/crc32c_ext.c +1 -0
  51. data/ext/digest/crc5/crc5.c +26 -25
  52. data/ext/digest/crc5/crc5_ext.c +1 -0
  53. data/ext/digest/crc64/crc64.c +74 -74
  54. data/ext/digest/crc64/crc64_ext.c +1 -0
  55. data/ext/digest/crc64_jones/crc64_jones.c +74 -74
  56. data/ext/digest/crc64_jones/crc64_jones_ext.c +1 -0
  57. data/ext/digest/crc64_xz/crc64_xz.c +74 -74
  58. data/ext/digest/crc64_xz/crc64_xz_ext.c +1 -0
  59. data/ext/digest/crc8/crc8.c +26 -25
  60. data/ext/digest/crc8/crc8_ext.c +1 -0
  61. data/ext/digest/crc8_1wire/crc8_1wire.c +26 -25
  62. data/ext/digest/crc8_1wire/crc8_1wire_ext.c +1 -0
  63. data/gemspec.yml +7 -4
  64. data/lib/digest/crc16_qt.rb +2 -1
  65. data/spec/crc16_qt_spec.rb +1 -1
  66. data/spec/integration/docker/Dockerfile.base +9 -0
  67. data/spec/integration/docker/Dockerfile.with-gcc +3 -0
  68. data/spec/integration/docker/Dockerfile.with-gcc-and-make +3 -0
  69. data/spec/integration/install_spec.rb +59 -0
  70. metadata +32 -7
  71. data/.travis.yml +0 -24
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1fe46270c7eae650508a5502eebb79a4869fbae54d0fbe839821d10875fb0ecf
4
- data.tar.gz: 4beab2099969546a407771454e5ded1a5490372418b33b078140f8cac82a2c97
3
+ metadata.gz: 60d4a283607198107ef66cb7e090570f5793c16c9641c791aff8a054d226655f
4
+ data.tar.gz: 4f4fb5821e6111d17e087a4160ea8f09a5cfd316324ae797f7a61be7cacd337a
5
5
  SHA512:
6
- metadata.gz: e62799bcab7e38e635d5619beb1ac13c9c4cc5c0017604b5e060672190fc7c5fdc6bfbdc48d164bf191d5906d868f4552a6318930a6fa3d1983cac63acdf8aa5
7
- data.tar.gz: ff41e5f57d9f9b523105b72f76662b8fac5a1df7485742378bb93ed3e982fb8d69eae14199e7d285e38102d7e3970708b6615919502783f6050278a029666360
6
+ metadata.gz: '07919fa492ae97de8969e359ec02bd57a0525665cfc8bbca69203f76e1a20593611bc6aa20840fca3672f4f1e592b608282ea85222dcafa88ab44d07fbc5433f'
7
+ data.tar.gz: 790f52517a7abd4b24eef5d17fa168d53c9392775b2baba1e496703391f84704944eb8a0651c37fd7c3be3766e32d07609b0c0adf9877e188c02995ed2244105
@@ -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@v2
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: 2.7
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,31 @@
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
+ - 2.4
16
+ - 2.5
17
+ - 2.6
18
+ - 2.7
19
+ - 3.0
20
+ - jruby
21
+ name: OS ${{ matrix.os }} / Ruby ${{ matrix.ruby }}
22
+ steps:
23
+ - uses: actions/checkout@v2
24
+ - name: Set up Ruby
25
+ uses: ruby/setup-ruby@v1
26
+ with:
27
+ ruby-version: ${{ matrix.ruby }}
28
+ - name: Install dependencies
29
+ run: bundle install --jobs 4 --retry 3
30
+ - name: Run tests
31
+ run: bundle exec rake spec
data/.gitignore CHANGED
@@ -8,3 +8,4 @@ pkg
8
8
  /ext/digest/crc*/extconf.h
9
9
  /ext/digest/crc*/*.o
10
10
  /ext/digest/crc*/*.so
11
+ /spec/integration/docker/digest-crc.gem
data/ChangeLog.md CHANGED
@@ -1,3 +1,28 @@
1
+ ### 0.6.4 / 2021-07-14
2
+
3
+ * Silence potential method redefinition warnings when loading the C extensions.
4
+ (@ojab)
5
+
6
+ ### 0.6.3 / 2020-12-19
7
+
8
+ * Broaden rake dependency to >= 12.0.0, < 14.0.0` for ruby 2.7, which includes
9
+ rake 13.x.
10
+
11
+ ### 0.6.2 / 2020-12-03
12
+
13
+ * Lower the rake dependency to `~> 12.0` for ruby 2.6.
14
+ * Fixed a bug in `ext/digest/Rakefile` which prevented digest-crc from being
15
+ installed on systems where C extensions could not be successfully compiled.
16
+ * Rake's `ruby` method, which in turn calls rake's `sh` method, raises
17
+ a `RuntimeError` exception when the ruby command fails, causing rake to
18
+ exit with an error code. Instead, rescue any `RuntimeError` exceptions and
19
+ fail gracefully.
20
+
21
+ ### 0.6.1 / 2020-07-02
22
+
23
+ * Fix installation issues under bundler by adding rake as an explicit dependency
24
+ (@rogerluan).
25
+
1
26
  ### 0.6.0 / 2020-07-01
2
27
 
3
28
  * Implement _optional_ C extensions for all CRC algorithms, resulting in an
@@ -174,4 +199,3 @@
174
199
  * CRC32
175
200
  * CRC32 Mpeg
176
201
  * CRC64
177
-
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010-2020 Hal Brodigan
1
+ Copyright (c) 2010-2021 Hal Brodigan
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -1,11 +1,10 @@
1
1
  # Digest CRC
2
2
 
3
- [![Build Status](https://travis-ci.org/postmodern/digest-crc.svg?branch=master)](https://travis-ci.org/postmodern/digest-crc)
3
+ [![CI](https://github.com/postmodern/digest-crc/actions/workflows/ruby.yml/badge.svg)](https://github.com/postmodern/digest-crc/actions/workflows/ruby.yml)
4
4
 
5
5
  * [Source](https://github.com/postmodern/digest-crc)
6
6
  * [Issues](https://github.com/postmodern/digest-crc/issues)
7
7
  * [Documentation](http://rubydoc.info/gems/digest-crc/frames)
8
- * [Email](mailto:postmodern.mod3 at gmail.com)
9
8
 
10
9
  ## Description
11
10
 
@@ -15,33 +14,33 @@ module.
15
14
  ## Features
16
15
 
17
16
  * Provides support for the following CRC algorithms:
18
- * {Digest::CRC1 CRC1}
19
- * {Digest::CRC5 CRC5}
20
- * {Digest::CRC8 CRC8}
21
- * {Digest::CRC8_1Wire CRC8 1-Wire}
22
- * {Digest::CRC15 CRC15}
23
- * {Digest::CRC16 CRC16}
24
- * {Digest::CRC16CCITT CRC16 CCITT}
25
- * {Digest::CRC16DNP CRC16 DNP}
26
- * {Digest::CRC16Genibus CRC16 Genibus}
27
- * {Digest::CRC16Kermit CRC16 Kermit}
28
- * {Digest::CRC16Modbus CRC16 Modbus}
29
- * {Digest::CRC16USB CRC16 USB}
30
- * {Digest::CRC16X25 CRC16 X25}
31
- * {Digest::CRC16XModem CRC16 XModem}
32
- * {Digest::CRC16ZModem CRC16 ZModem}
33
- * {Digest::CRC16QT CRC16 QT}
34
- * {Digest::CRC24 CRC24}
35
- * {Digest::CRC32 CRC32}
36
- * {Digest::CRC32BZip2 CRC32 BZip2}
37
- * {Digest::CRC32c CRC32c}
38
- * {Digest::CRC32Jam CRC32 Jam}
39
- * {Digest::CRC32MPEG CRC32 MPEG}
40
- * {Digest::CRC32POSIX CRC32 POSIX}
41
- * {Digest::CRC32XFER CRC32 XFER}
42
- * {Digest::CRC64 CRC64}
43
- * {Digest::CRC64Jones CRC64 Jones}
44
- * {Digest::CRC64XZ CRC64 XZ}
17
+ * [CRC1](https://rubydoc.info/gems/digest-crc/Digest/CRC1)
18
+ * [CRC5](https://rubydoc.info/gems/digest-crc/Digest/CRC5)
19
+ * [CRC8](https://rubydoc.info/gems/digest-crc/Digest/CRC8)
20
+ * [CRC8 1-Wire](https://rubydoc.info/gems/digest-crc/Digest/CRC8_1Wire)
21
+ * [CRC15](https://rubydoc.info/gems/digest-crc/Digest/CRC15)
22
+ * [CRC16](https://rubydoc.info/gems/digest-crc/Digest/CRC16)
23
+ * [CRC16 CCITT](https://rubydoc.info/gems/digest-crc/Digest/CRC16CCITT)
24
+ * [CRC16 DNP](https://rubydoc.info/gems/digest-crc/Digest/CRC16DNP)
25
+ * [CRC16 Genibus](https://rubydoc.info/gems/digest-crc/Digest/CRC16Genibus)
26
+ * [CRC16 Kermit](https://rubydoc.info/gems/digest-crc/Digest/CRC16Kermit)
27
+ * [CRC16 Modbus](https://rubydoc.info/gems/digest-crc/Digest/CRC16Modbus)
28
+ * [CRC16 USB](https://rubydoc.info/gems/digest-crc/Digest/CRC16USB)
29
+ * [CRC16 X25](https://rubydoc.info/gems/digest-crc/Digest/CRC16X25)
30
+ * [CRC16 XModem](https://rubydoc.info/gems/digest-crc/Digest/CRC16XModem)
31
+ * [CRC16 ZModem](https://rubydoc.info/gems/digest-crc/Digest/CRC16ZModem)
32
+ * [CRC16 QT](https://rubydoc.info/gems/digest-crc/Digest/CRC16QT)
33
+ * [CRC24](https://rubydoc.info/gems/digest-crc/Digest/CRC24)
34
+ * [CRC32](https://rubydoc.info/gems/digest-crc/Digest/CRC32)
35
+ * [CRC32 BZip2](https://rubydoc.info/gems/digest-crc/Digest/CRC32BZip2)
36
+ * [CRC32c](https://rubydoc.info/gems/digest-crc/Digest/CRC32c)
37
+ * [CRC32 Jam](https://rubydoc.info/gems/digest-crc/Digest/CRC32Jam)
38
+ * [CRC32 MPEG](https://rubydoc.info/gems/digest-crc/Digest/CRC32MPEG)
39
+ * [CRC32 POSIX](https://rubydoc.info/gems/digest-crc/Digest/CRC32POSIX)
40
+ * [CRC32 XFER](https://rubydoc.info/gems/digest-crc/Digest/CRC32XFER)
41
+ * [CRC64](https://rubydoc.info/gems/digest-crc/Digest/CRC64)
42
+ * [CRC64 Jones](https://rubydoc.info/gems/digest-crc/Digest/CRC64Jones)
43
+ * [CRC64 XZ](https://rubydoc.info/gems/digest-crc/Digest/CRC64XZ)
45
44
  * Pure Ruby implementation.
46
45
  * Provides CRC Tables for optimized calculations.
47
46
  * Supports _optional_ C extensions which increases performance by ~40x.
@@ -54,6 +53,24 @@ module.
54
53
  gem install digest-crc
55
54
  ```
56
55
 
56
+ **Note:** to enable the C extensions ensure that you are using CRuby and have
57
+ a C compiler (`gcc` or `clang`) and `make` installed, _before_ installing
58
+ digest-crc.
59
+
60
+ * Debian / Ubuntu:
61
+
62
+ $ sudo apt install gcc make
63
+
64
+ * RedHat / Fedora:
65
+
66
+ $ sudo dnf install gcc make
67
+
68
+ * Alpine Linux:
69
+
70
+ $ apk add build-base
71
+
72
+ * macOS: install XCode
73
+
57
74
  ## Examples
58
75
 
59
76
  Calculate a CRC32:
@@ -119,6 +136,263 @@ module Digest
119
136
  end
120
137
  ```
121
138
 
139
+ ## Benchmarks
140
+
141
+ ### Ruby 2.7.4 (pure Ruby)
142
+
143
+ $ bundle exec rake clean
144
+ $ bundle exec ./benchmarks.rb
145
+ Loading Digest::CRC classes ...
146
+ Generating 1000 8Kb lengthed strings ...
147
+ Benchmarking Digest::CRC classes ...
148
+ user system total real
149
+ Digest::CRC1#update 0.423741 0.000000 0.423741 ( 0.425887)
150
+ Digest::CRC5#update 1.486578 0.000011 1.486589 ( 1.493215)
151
+ Digest::CRC8#update 1.261386 0.000000 1.261386 ( 1.266399)
152
+ Digest::CRC8_1Wire#update 1.250344 0.000000 1.250344 ( 1.255009)
153
+ Digest::CRC15#update 1.482515 0.000000 1.482515 ( 1.488131)
154
+ Digest::CRC16#update 1.216744 0.000811 1.217555 ( 1.222228)
155
+ Digest::CRC16CCITT#update 1.480490 0.000000 1.480490 ( 1.486745)
156
+ Digest::CRC16DNP#update 1.200067 0.000000 1.200067 ( 1.204835)
157
+ Digest::CRC16Genibus#update 1.492910 0.000000 1.492910 ( 1.498923)
158
+ Digest::CRC16Modbus#update 1.217449 0.000003 1.217452 ( 1.222348)
159
+ Digest::CRC16QT#update 1.223311 0.000000 1.223311 ( 1.229211)
160
+ Digest::CRC16USB#update 1.233744 0.000000 1.233744 ( 1.238615)
161
+ Digest::CRC16X25#update 1.223077 0.000000 1.223077 ( 1.227607)
162
+ Digest::CRC16XModem#update 1.487674 0.000000 1.487674 ( 1.493316)
163
+ Digest::CRC16ZModem#update 1.484288 0.000000 1.484288 ( 1.490096)
164
+ Digest::CRC24#update 1.490272 0.000000 1.490272 ( 1.496027)
165
+ Digest::CRC32#update 1.225311 0.000000 1.225311 ( 1.230572)
166
+ Digest::CRC32BZip2#update 1.503096 0.000000 1.503096 ( 1.509202)
167
+ Digest::CRC32c#update 1.220390 0.000000 1.220390 ( 1.225487)
168
+ Digest::CRC32Jam#update 1.216066 0.000000 1.216066 ( 1.220591)
169
+ Digest::CRC32MPEG#update 1.486808 0.000000 1.486808 ( 1.492611)
170
+ Digest::CRC32POSIX#update 1.494508 0.000957 1.495465 ( 1.503262)
171
+ Digest::CRC32XFER#update 1.504802 0.005830 1.510632 ( 1.522066)
172
+ Digest::CRC64#update 3.260784 0.015674 3.276458 ( 3.310506)
173
+ Digest::CRC64Jones#update 3.195204 0.000000 3.195204 ( 3.213054)
174
+ Digest::CRC64XZ#update 3.173597 0.000000 3.173597 ( 3.190438)
175
+
176
+ ### Ruby 2.7.4 (C extensions)
177
+
178
+ $ bundle exec rake build:c_exts
179
+ ...
180
+ $ bundle exec ./benchmarks.rb
181
+ Loading Digest::CRC classes ...
182
+ Generating 1000 8Kb lengthed strings ...
183
+ Benchmarking Digest::CRC classes ...
184
+ user system total real
185
+ Digest::CRC1#update 0.443619 0.000007 0.443626 ( 0.446545)
186
+ Digest::CRC5#update 0.025134 0.000806 0.025940 ( 0.026129)
187
+ Digest::CRC8#update 0.022564 0.000000 0.022564 ( 0.022775)
188
+ Digest::CRC8_1Wire#update 0.021427 0.000008 0.021435 ( 0.021551)
189
+ Digest::CRC15#update 0.030377 0.000833 0.031210 ( 0.031406)
190
+ Digest::CRC16#update 0.024004 0.000002 0.024006 ( 0.024418)
191
+ Digest::CRC16CCITT#update 0.026930 0.000001 0.026931 ( 0.027238)
192
+ Digest::CRC16DNP#update 0.024279 0.000000 0.024279 ( 0.024446)
193
+ Digest::CRC16Genibus#update 0.026477 0.000004 0.026481 ( 0.026656)
194
+ Digest::CRC16Modbus#update 0.023568 0.000000 0.023568 ( 0.023704)
195
+ Digest::CRC16QT#update 0.024161 0.000000 0.024161 ( 0.024316)
196
+ Digest::CRC16USB#update 0.023891 0.000000 0.023891 ( 0.024038)
197
+ Digest::CRC16X25#update 0.023849 0.000000 0.023849 ( 0.023991)
198
+ Digest::CRC16XModem#update 0.026254 0.000000 0.026254 ( 0.026523)
199
+ Digest::CRC16ZModem#update 0.026391 0.000000 0.026391 ( 0.026529)
200
+ Digest::CRC24#update 0.028805 0.000854 0.029659 ( 0.029830)
201
+ Digest::CRC32#update 0.024030 0.000000 0.024030 ( 0.024200)
202
+ Digest::CRC32BZip2#update 0.026942 0.000000 0.026942 ( 0.027244)
203
+ Digest::CRC32c#update 0.023989 0.000000 0.023989 ( 0.024159)
204
+ Digest::CRC32Jam#update 0.023940 0.000000 0.023940 ( 0.024066)
205
+ Digest::CRC32MPEG#update 0.027063 0.000000 0.027063 ( 0.027213)
206
+ Digest::CRC32POSIX#update 0.027137 0.000000 0.027137 ( 0.028160)
207
+ Digest::CRC32XFER#update 0.026956 0.000002 0.026958 ( 0.027103)
208
+ Digest::CRC64#update 0.024222 0.000005 0.024227 ( 0.024796)
209
+ Digest::CRC64Jones#update 0.025331 0.000000 0.025331 ( 0.025789)
210
+ Digest::CRC64XZ#update 0.024131 0.000001 0.024132 ( 0.024348)
211
+
212
+ ### Ruby 3.0.2 (pure Ruby)
213
+
214
+ $ bundle exec rake clean
215
+ $ bundle exec ./benchmarks.rb
216
+ Loading Digest::CRC classes ...
217
+ Generating 1000 8Kb lengthed strings ...
218
+ Benchmarking Digest::CRC classes ...
219
+ user system total real
220
+ Digest::CRC1#update 0.331405 0.000002 0.331407 ( 0.333588)
221
+ Digest::CRC5#update 1.206847 0.000020 1.206867 ( 1.224072)
222
+ Digest::CRC8#update 1.018571 0.000000 1.018571 ( 1.023002)
223
+ Digest::CRC8_1Wire#update 1.018802 0.000000 1.018802 ( 1.023292)
224
+ Digest::CRC15#update 1.207586 0.000000 1.207586 ( 1.212691)
225
+ Digest::CRC16#update 1.032505 0.000965 1.033470 ( 1.040862)
226
+ Digest::CRC16CCITT#update 1.198079 0.000000 1.198079 ( 1.203134)
227
+ Digest::CRC16DNP#update 0.994582 0.000000 0.994582 ( 1.006520)
228
+ Digest::CRC16Genibus#update 1.190596 0.000000 1.190596 ( 1.196087)
229
+ Digest::CRC16Modbus#update 1.007826 0.000000 1.007826 ( 1.012934)
230
+ Digest::CRC16QT#update 0.996298 0.000001 0.996299 ( 1.000255)
231
+ Digest::CRC16USB#update 0.995806 0.000000 0.995806 ( 0.999822)
232
+ Digest::CRC16X25#update 1.019589 0.000000 1.019589 ( 1.031010)
233
+ Digest::CRC16XModem#update 1.146947 0.000000 1.146947 ( 1.150817)
234
+ Digest::CRC16ZModem#update 1.145145 0.000000 1.145145 ( 1.149483)
235
+ Digest::CRC24#update 1.149009 0.000000 1.149009 ( 1.152854)
236
+ Digest::CRC32#update 0.970976 0.000000 0.970976 ( 0.974227)
237
+ Digest::CRC32BZip2#update 1.148596 0.000000 1.148596 ( 1.152381)
238
+ Digest::CRC32c#update 0.972566 0.000000 0.972566 ( 0.975790)
239
+ Digest::CRC32Jam#update 0.975854 0.000000 0.975854 ( 0.979217)
240
+ Digest::CRC32MPEG#update 1.148578 0.000000 1.148578 ( 1.153088)
241
+ Digest::CRC32POSIX#update 1.146218 0.000986 1.147204 ( 1.152460)
242
+ Digest::CRC32XFER#update 1.149823 0.000000 1.149823 ( 1.153692)
243
+ Digest::CRC64#update 2.869948 0.000016 2.869964 ( 2.884261)
244
+ Digest::CRC64Jones#update 2.867662 0.000000 2.867662 ( 2.886559)
245
+ Digest::CRC64XZ#update 2.858847 0.000000 2.858847 ( 2.874058)
246
+
247
+ ### Ruby 3.0.2 (C extensions)
248
+
249
+ $ bundle exec rake build:c_exts
250
+ ...
251
+ $ bundle exec ./benchmarks.rb
252
+ Loading Digest::CRC classes ...
253
+ Generating 1000 8Kb lengthed strings ...
254
+ Benchmarking Digest::CRC classes ...
255
+ user system total real
256
+ Digest::CRC1#update 0.349055 0.000000 0.349055 ( 0.350454)
257
+ Digest::CRC5#update 0.023144 0.000000 0.023144 ( 0.023248)
258
+ Digest::CRC8#update 0.021378 0.000000 0.021378 ( 0.021522)
259
+ Digest::CRC8_1Wire#update 0.021019 0.000000 0.021019 ( 0.021145)
260
+ Digest::CRC15#update 0.030063 0.000003 0.030066 ( 0.030245)
261
+ Digest::CRC16#update 0.024395 0.000000 0.024395 ( 0.024572)
262
+ Digest::CRC16CCITT#update 0.026979 0.000000 0.026979 ( 0.027138)
263
+ Digest::CRC16DNP#update 0.024665 0.000000 0.024665 ( 0.024844)
264
+ Digest::CRC16Genibus#update 0.027054 0.000000 0.027054 ( 0.027217)
265
+ Digest::CRC16Modbus#update 0.023963 0.000000 0.023963 ( 0.024257)
266
+ Digest::CRC16QT#update 0.024218 0.000000 0.024218 ( 0.024360)
267
+ Digest::CRC16USB#update 0.024393 0.000000 0.024393 ( 0.024561)
268
+ Digest::CRC16X25#update 0.025127 0.000000 0.025127 ( 0.025292)
269
+ Digest::CRC16XModem#update 0.028123 0.000000 0.028123 ( 0.028377)
270
+ Digest::CRC16ZModem#update 0.028205 0.000000 0.028205 ( 0.028571)
271
+ Digest::CRC24#update 0.031386 0.000000 0.031386 ( 0.031740)
272
+ Digest::CRC32#update 0.023832 0.000000 0.023832 ( 0.023948)
273
+ Digest::CRC32BZip2#update 0.027159 0.000000 0.027159 ( 0.027315)
274
+ Digest::CRC32c#update 0.024172 0.000000 0.024172 ( 0.024310)
275
+ Digest::CRC32Jam#update 0.024376 0.000000 0.024376 ( 0.024494)
276
+ Digest::CRC32MPEG#update 0.026035 0.000784 0.026819 ( 0.026940)
277
+ Digest::CRC32POSIX#update 0.026784 0.000000 0.026784 ( 0.026907)
278
+ Digest::CRC32XFER#update 0.026770 0.000000 0.026770 ( 0.026893)
279
+ Digest::CRC64#update 0.024400 0.000009 0.024409 ( 0.024531)
280
+ Digest::CRC64Jones#update 0.023477 0.000781 0.024258 ( 0.024390)
281
+ Digest::CRC64XZ#update 0.024611 0.000000 0.024611 ( 0.024779)
282
+
283
+ ### JRuby 9.2.18.0 (pure Ruby)
284
+
285
+ $ bundle exec ./benchmarks.rb
286
+ Loading Digest::CRC classes ...
287
+ Generating 1000 8Kb lengthed strings ...
288
+ Benchmarking Digest::CRC classes ...
289
+ user system total real
290
+ Digest::CRC1#update 1.080000 0.050000 1.130000 ( 0.676022)
291
+ Digest::CRC5#update 2.030000 0.040000 2.070000 ( 1.089240)
292
+ Digest::CRC8#update 1.590000 0.000000 1.590000 ( 0.999138)
293
+ Digest::CRC8_1Wire#update 0.920000 0.010000 0.930000 ( 0.873813)
294
+ Digest::CRC15#update 1.470000 0.030000 1.500000 ( 1.118886)
295
+ Digest::CRC16#update 1.780000 0.010000 1.790000 ( 1.067874)
296
+ Digest::CRC16CCITT#update 1.500000 0.070000 1.570000 ( 1.185564)
297
+ Digest::CRC16DNP#update 1.250000 0.000000 1.250000 ( 0.972322)
298
+ Digest::CRC16Genibus#update 1.700000 0.010000 1.710000 ( 1.092047)
299
+ Digest::CRC16Modbus#update 1.000000 0.010000 1.010000 ( 0.915328)
300
+ Digest::CRC16QT#update 1.250000 0.000000 1.250000 ( 0.968528)
301
+ Digest::CRC16USB#update 1.150000 0.010000 1.160000 ( 0.990387)
302
+ Digest::CRC16X25#update 0.940000 0.000000 0.940000 ( 0.926926)
303
+ Digest::CRC16XModem#update 1.390000 0.010000 1.400000 ( 1.100584)
304
+ Digest::CRC16ZModem#update 1.760000 0.020000 1.780000 ( 1.094003)
305
+ Digest::CRC24#update 1.690000 0.010000 1.700000 ( 1.106875)
306
+ Digest::CRC32#update 1.410000 0.020000 1.430000 ( 1.082506)
307
+ Digest::CRC32BZip2#update 1.510000 0.010000 1.520000 ( 1.104225)
308
+ Digest::CRC32c#update 1.270000 0.010000 1.280000 ( 1.023881)
309
+ Digest::CRC32Jam#update 1.190000 0.010000 1.200000 ( 0.998146)
310
+ Digest::CRC32MPEG#update 1.580000 0.010000 1.590000 ( 1.099086)
311
+ Digest::CRC32POSIX#update 1.550000 0.010000 1.560000 ( 1.142051)
312
+ Digest::CRC32XFER#update 1.360000 0.000000 1.360000 ( 1.071381)
313
+ Digest::CRC64#update 3.730000 0.020000 3.750000 ( 2.780390)
314
+ Digest::CRC64Jones#update 2.710000 0.020000 2.730000 ( 2.608007)
315
+ Digest::CRC64XZ#update 2.910000 0.020000 2.930000 ( 2.629401)
316
+
317
+ ### TruffleRuby 21.2.0 (pure Ruby)
318
+
319
+ $ bundle exec rake clean
320
+ $ bundle exec ./benchmarks.rb
321
+ Loading Digest::CRC classes ...
322
+ Generating 1000 8Kb lengthed strings ...
323
+ Benchmarking Digest::CRC classes ...
324
+ user system total real
325
+ Digest::CRC1#update 0.455340 0.000000 0.455340 ( 0.457710)
326
+ Digest::CRC5#update 1.406700 0.000000 1.406700 ( 1.412535)
327
+ Digest::CRC8#update 1.248323 0.000000 1.248323 ( 1.255452)
328
+ Digest::CRC8_1Wire#update 1.269434 0.000000 1.269434 ( 1.275315)
329
+ Digest::CRC15#update 1.428752 0.000000 1.428752 ( 1.434836)
330
+ Digest::CRC16#update 1.220394 0.000967 1.221361 ( 1.229684)
331
+ Digest::CRC16CCITT#update 1.434932 0.001000 1.435932 ( 1.452391)
332
+ Digest::CRC16DNP#update 1.191351 0.000000 1.191351 ( 1.202262)
333
+ Digest::CRC16Genibus#update 1.434067 0.000000 1.434067 ( 1.440300)
334
+ Digest::CRC16Modbus#update 1.200827 0.000000 1.200827 ( 1.205658)
335
+ Digest::CRC16QT#update 1.195077 0.000000 1.195077 ( 1.200328)
336
+ Digest::CRC16USB#update 1.196266 0.000000 1.196266 ( 1.201262)
337
+ Digest::CRC16X25#update 1.206690 0.000000 1.206690 ( 1.211781)
338
+ Digest::CRC16XModem#update 1.430468 0.000000 1.430468 ( 1.436801)
339
+ Digest::CRC16ZModem#update 1.442524 0.000000 1.442524 ( 1.448624)
340
+ Digest::CRC24#update 1.447611 0.000018 1.447629 ( 1.454534)
341
+ Digest::CRC32#update 1.214314 0.000000 1.214314 ( 1.219838)
342
+ Digest::CRC32BZip2#update 1.427408 0.000000 1.427408 ( 1.433626)
343
+ Digest::CRC32c#update 1.204985 0.000000 1.204985 ( 1.210273)
344
+ Digest::CRC32Jam#update 1.235039 0.000000 1.235039 ( 1.240686)
345
+ Digest::CRC32MPEG#update 1.429731 0.000000 1.429731 ( 1.435404)
346
+ Digest::CRC32POSIX#update 1.458886 0.000000 1.458886 ( 1.465914)
347
+ Digest::CRC32XFER#update 1.422109 0.000000 1.422109 ( 1.427635)
348
+ Digest::CRC64#update 3.283506 0.000000 3.283506 ( 3.303129)
349
+ Digest::CRC64Jones#update 3.297402 0.000000 3.297402 ( 3.317357)
350
+ Digest::CRC64XZ#update 3.278551 0.001875 3.280426 ( 3.315165)
351
+
352
+
353
+ ### TruffleRuby 21.2.0 (C extensions)
354
+
355
+ $ bundle exec rake build:c_exts
356
+ ...
357
+ $ bundle exec ./benchmarks.rb
358
+ Loading Digest::CRC classes ...
359
+ Generating 1000 8Kb lengthed strings ...
360
+ Benchmarking Digest::CRC classes ...
361
+ user system total real
362
+ Digest::CRC1#update 0.480586 0.000014 0.480600 ( 0.482817)
363
+ Digest::CRC5#update 0.023795 0.000000 0.023795 ( 0.023941)
364
+ Digest::CRC8#update 0.020619 0.000000 0.020619 ( 0.020747)
365
+ Digest::CRC8_1Wire#update 0.020571 0.000000 0.020571 ( 0.020700)
366
+ Digest::CRC15#update 0.031224 0.000000 0.031224 ( 0.031412)
367
+ Digest::CRC16#update 0.024013 0.000000 0.024013 ( 0.024174)
368
+ Digest::CRC16CCITT#update 0.026790 0.000000 0.026790 ( 0.027079)
369
+ Digest::CRC16DNP#update 0.024253 0.000000 0.024253 ( 0.024427)
370
+ Digest::CRC16Genibus#update 0.027237 0.000000 0.027237 ( 0.027390)
371
+ Digest::CRC16Modbus#update 0.024376 0.000000 0.024376 ( 0.024548)
372
+ Digest::CRC16QT#update 0.024361 0.000000 0.024361 ( 0.024518)
373
+ Digest::CRC16USB#update 0.024142 0.000000 0.024142 ( 0.024311)
374
+ Digest::CRC16X25#update 0.024098 0.000000 0.024098 ( 0.024222)
375
+ Digest::CRC16XModem#update 0.026306 0.000000 0.026306 ( 0.026502)
376
+ Digest::CRC16ZModem#update 0.026536 0.000000 0.026536 ( 0.026688)
377
+ Digest::CRC24#update 0.029732 0.000000 0.029732 ( 0.029902)
378
+ Digest::CRC32#update 0.024219 0.000000 0.024219 ( 0.024391)
379
+ Digest::CRC32BZip2#update 0.026817 0.000000 0.026817 ( 0.027044)
380
+ Digest::CRC32c#update 0.023681 0.000000 0.023681 ( 0.023798)
381
+ Digest::CRC32Jam#update 0.024243 0.000000 0.024243 ( 0.024419)
382
+ Digest::CRC32MPEG#update 0.026865 0.000000 0.026865 ( 0.027020)
383
+ Digest::CRC32POSIX#update 0.026583 0.000000 0.026583 ( 0.026748)
384
+ Digest::CRC32XFER#update 0.027423 0.000000 0.027423 ( 0.027615)
385
+ Digest::CRC64#update 0.024150 0.000000 0.024150 ( 0.024310)
386
+ Digest::CRC64Jones#update 0.024218 0.000000 0.024218 ( 0.024363)
387
+ Digest::CRC64XZ#update 0.024124 0.000000 0.024124 ( 0.024255)
388
+
389
+ ## Crystal
390
+
391
+ [crystal-crc] is a [Crystal][crystal-lang] port of this library.
392
+
393
+ [crystal-crc]: https://github.com/postmodern/crystal-crc
394
+ [crystal-lang]: https://www.crystal-lang.org/
395
+
122
396
  ## Thanks
123
397
 
124
398
  Special thanks go out to the [pycrc](http://www.tty1.net/pycrc/) library
@@ -127,6 +401,6 @@ including their CRC Tables.
127
401
 
128
402
  ## License
129
403
 
130
- Copyright (c) 2010-2020 Hal Brodigan
404
+ Copyright (c) 2010-2021 Hal Brodigan
131
405
 
132
406
  See {file:LICENSE.txt} for license information.