digest-crc 0.4.0 → 0.6.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +6 -0
- data/.travis.yml +24 -0
- data/ChangeLog.md +102 -0
- data/Gemfile +15 -0
- data/LICENSE.txt +1 -1
- data/README.md +71 -17
- data/Rakefile +31 -23
- data/benchmarks.rb +58 -0
- data/digest-crc.gemspec +2 -1
- data/ext/digest/Rakefile +51 -0
- data/ext/digest/compat/ruby.h +11 -0
- data/ext/digest/crc12_3gpp/crc12_3gpp.c +66 -0
- data/ext/digest/crc12_3gpp/crc12_3gpp.h +11 -0
- data/ext/digest/crc12_3gpp/crc12_3gpp_ext.c +27 -0
- data/ext/digest/crc12_3gpp/extconf.rb +7 -0
- data/ext/digest/crc15/crc15.c +53 -0
- data/ext/digest/crc15/crc15.h +11 -0
- data/ext/digest/crc15/crc15_ext.c +28 -0
- data/ext/digest/crc15/extconf.rb +7 -0
- data/ext/digest/crc16/crc16.c +69 -0
- data/ext/digest/crc16/crc16.h +11 -0
- data/ext/digest/crc16/crc16_ext.c +28 -0
- data/ext/digest/crc16/extconf.rb +7 -0
- data/ext/digest/crc16_ccitt/crc16_ccitt.c +69 -0
- data/ext/digest/crc16_ccitt/crc16_ccitt.h +8 -0
- data/ext/digest/crc16_ccitt/crc16_ccitt_ext.c +28 -0
- data/ext/digest/crc16_ccitt/extconf.rb +7 -0
- data/ext/digest/crc16_dnp/crc16_dnp.c +53 -0
- data/ext/digest/crc16_dnp/crc16_dnp.h +8 -0
- data/ext/digest/crc16_dnp/crc16_dnp_ext.c +28 -0
- data/ext/digest/crc16_dnp/extconf.rb +7 -0
- data/ext/digest/crc16_genibus/crc16_genibus.c +69 -0
- data/ext/digest/crc16_genibus/crc16_genibus.h +8 -0
- data/ext/digest/crc16_genibus/crc16_genibus_ext.c +28 -0
- data/ext/digest/crc16_genibus/extconf.rb +7 -0
- data/ext/digest/crc16_kermit/crc16_kermit.c +69 -0
- data/ext/digest/crc16_kermit/crc16_kermit.h +8 -0
- data/ext/digest/crc16_kermit/crc16_kermit_ext.c +28 -0
- data/ext/digest/crc16_kermit/extconf.rb +7 -0
- data/ext/digest/crc16_modbus/crc16_modbus.c +69 -0
- data/ext/digest/crc16_modbus/crc16_modbus.h +8 -0
- data/ext/digest/crc16_modbus/crc16_modbus_ext.c +28 -0
- data/ext/digest/crc16_modbus/extconf.rb +7 -0
- data/ext/digest/crc16_usb/crc16_usb.c +69 -0
- data/ext/digest/crc16_usb/crc16_usb.h +8 -0
- data/ext/digest/crc16_usb/crc16_usb_ext.c +28 -0
- data/ext/digest/crc16_usb/extconf.rb +7 -0
- data/ext/digest/crc16_x_25/crc16_x_25.c +69 -0
- data/ext/digest/crc16_x_25/crc16_x_25.h +8 -0
- data/ext/digest/crc16_x_25/crc16_x_25_ext.c +28 -0
- data/ext/digest/crc16_x_25/extconf.rb +7 -0
- data/ext/digest/crc16_xmodem/crc16_xmodem.c +69 -0
- data/ext/digest/crc16_xmodem/crc16_xmodem.h +8 -0
- data/ext/digest/crc16_xmodem/crc16_xmodem_ext.c +28 -0
- data/ext/digest/crc16_xmodem/extconf.rb +7 -0
- data/ext/digest/crc16_zmodem/crc16_zmodem.c +69 -0
- data/ext/digest/crc16_zmodem/crc16_zmodem.h +8 -0
- data/ext/digest/crc16_zmodem/crc16_zmodem_ext.c +28 -0
- data/ext/digest/crc16_zmodem/extconf.rb +7 -0
- data/ext/digest/crc24/crc24.c +69 -0
- data/ext/digest/crc24/crc24.h +11 -0
- data/ext/digest/crc24/crc24_ext.c +27 -0
- data/ext/digest/crc24/extconf.rb +7 -0
- data/ext/digest/crc32/crc32.c +68 -0
- data/ext/digest/crc32/crc32.h +11 -0
- data/ext/digest/crc32/crc32_ext.c +27 -0
- data/ext/digest/crc32/extconf.rb +7 -0
- data/ext/digest/crc32_bzip2/crc32_bzip2.c +69 -0
- data/ext/digest/crc32_bzip2/crc32_bzip2.h +8 -0
- data/ext/digest/crc32_bzip2/crc32_bzip2_ext.c +27 -0
- data/ext/digest/crc32_bzip2/extconf.rb +7 -0
- data/ext/digest/crc32_jam/crc32_jam.c +69 -0
- data/ext/digest/crc32_jam/crc32_jam.h +8 -0
- data/ext/digest/crc32_jam/crc32_jam_ext.c +27 -0
- data/ext/digest/crc32_jam/extconf.rb +7 -0
- data/ext/digest/crc32_mpeg/crc32_mpeg.c +69 -0
- data/ext/digest/crc32_mpeg/crc32_mpeg.h +8 -0
- data/ext/digest/crc32_mpeg/crc32_mpeg_ext.c +27 -0
- data/ext/digest/crc32_mpeg/extconf.rb +7 -0
- data/ext/digest/crc32_posix/crc32_posix.c +69 -0
- data/ext/digest/crc32_posix/crc32_posix.h +8 -0
- data/ext/digest/crc32_posix/crc32_posix_ext.c +27 -0
- data/ext/digest/crc32_posix/extconf.rb +7 -0
- data/ext/digest/crc32_xfer/crc32_xfer.c +69 -0
- data/ext/digest/crc32_xfer/crc32_xfer.h +8 -0
- data/ext/digest/crc32_xfer/crc32_xfer_ext.c +27 -0
- data/ext/digest/crc32_xfer/extconf.rb +7 -0
- data/ext/digest/crc32c/crc32c.c +69 -0
- data/ext/digest/crc32c/crc32c.h +8 -0
- data/ext/digest/crc32c/crc32c_ext.c +27 -0
- data/ext/digest/crc32c/extconf.rb +7 -0
- data/ext/digest/crc5/crc5.c +53 -0
- data/ext/digest/crc5/crc5.h +11 -0
- data/ext/digest/crc5/crc5_ext.c +27 -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 +27 -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 +27 -0
- data/ext/digest/crc64_jones/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 +27 -0
- data/ext/digest/crc64_xz/extconf.rb +7 -0
- data/ext/digest/crc8/crc8.c +53 -0
- data/ext/digest/crc8/crc8.h +11 -0
- data/ext/digest/crc8/crc8_ext.c +27 -0
- data/ext/digest/crc8/extconf.rb +7 -0
- data/ext/digest/crc8_1wire/crc8_1wire.c +53 -0
- data/ext/digest/crc8_1wire/crc8_1wire.h +8 -0
- data/ext/digest/crc8_1wire/crc8_1wire_ext.c +27 -0
- data/ext/digest/crc8_1wire/extconf.rb +7 -0
- data/gemspec.yml +14 -6
- data/lib/digest/crc.rb +23 -7
- data/lib/digest/crc1.rb +0 -3
- data/lib/digest/crc15.rb +70 -0
- data/lib/digest/crc16.rb +6 -2
- data/lib/digest/crc16_ccitt.rb +7 -3
- data/lib/digest/crc16_dnp.rb +6 -2
- data/lib/digest/crc16_genibus.rb +72 -0
- data/lib/digest/crc16_kermit.rb +66 -0
- data/lib/digest/crc16_modbus.rb +5 -15
- data/lib/digest/crc16_qt.rb +11 -9
- data/lib/digest/crc16_usb.rb +4 -0
- data/lib/digest/crc16_x_25.rb +56 -0
- data/lib/digest/crc16_xmodem.rb +6 -2
- data/lib/digest/crc16_zmodem.rb +6 -2
- data/lib/digest/crc24.rb +6 -2
- data/lib/digest/crc32.rb +6 -2
- data/lib/digest/crc32_bzip2.rb +64 -0
- data/lib/digest/crc32_jam.rb +16 -0
- data/lib/digest/crc32_mpeg.rb +11 -3
- data/lib/digest/crc32_posix.rb +65 -0
- data/lib/digest/crc32_xfer.rb +68 -0
- data/lib/digest/crc32c.rb +5 -15
- data/lib/digest/crc5.rb +28 -2
- data/lib/digest/crc64.rb +6 -2
- data/lib/digest/crc64_jones.rb +88 -0
- data/lib/digest/crc64_xz.rb +90 -0
- data/lib/digest/crc8.rb +6 -2
- data/lib/digest/crc8_1wire.rb +9 -33
- data/spec/crc15_spec.rb +10 -0
- data/spec/crc16_genibus_spec.rb +10 -0
- data/spec/crc16_kermit_spec.rb +10 -0
- data/spec/crc16_x_25_spec.rb +10 -0
- data/spec/crc32_bzip2_spec.rb +10 -0
- data/spec/crc32_jam_spec.rb +10 -0
- data/spec/crc32_mpeg_spec.rb +7 -1
- data/spec/crc32_posix_spec.rb +10 -0
- data/spec/crc32_xfer_spec.rb +10 -0
- data/spec/crc64_jones_spec.rb +10 -0
- data/spec/crc64_xz_spec.rb +10 -0
- data/spec/crc8_1wire_spec.rb +7 -1
- data/spec/crc_examples.rb +3 -3
- data/spec/crc_spec.rb +63 -5
- data/spec/spec_helper.rb +0 -1
- metadata +151 -54
- data/.gemtest +0 -0
data/lib/digest/crc16_zmodem.rb
CHANGED
@@ -40,7 +40,7 @@ module Digest
|
|
40
40
|
0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1,
|
41
41
|
0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8,
|
42
42
|
0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0
|
43
|
-
]
|
43
|
+
].freeze
|
44
44
|
|
45
45
|
#
|
46
46
|
# Updates the CRC16 checksum.
|
@@ -50,7 +50,7 @@ module Digest
|
|
50
50
|
#
|
51
51
|
def update(data)
|
52
52
|
data.each_byte do |b|
|
53
|
-
@crc = ((
|
53
|
+
@crc = ((@table[((@crc >> 8) ^ b) & 0xff] ^ (@crc << 8)) & 0xffff)
|
54
54
|
end
|
55
55
|
|
56
56
|
return self
|
@@ -58,3 +58,7 @@ module Digest
|
|
58
58
|
|
59
59
|
end
|
60
60
|
end
|
61
|
+
|
62
|
+
if RUBY_ENGINE == 'ruby'
|
63
|
+
begin; require 'digest/crc16_zmodem/crc16_zmodem_ext'; rescue LoadError; end
|
64
|
+
end
|
data/lib/digest/crc24.rb
CHANGED
@@ -44,7 +44,7 @@ module Digest
|
|
44
44
|
0x87b4a6, 0x01f85d, 0x0d61ab, 0x8b2d50, 0x145247, 0x921ebc, 0x9e874a, 0x18cbb1,
|
45
45
|
0xe37b16, 0x6537ed, 0x69ae1b, 0xefe2e0, 0x709df7, 0xf6d10c, 0xfa48fa, 0x7c0401,
|
46
46
|
0x42fa2f, 0xc4b6d4, 0xc82f22, 0x4e63d9, 0xd11cce, 0x575035, 0x5bc9c3, 0xdd8538
|
47
|
-
]
|
47
|
+
].freeze
|
48
48
|
|
49
49
|
#
|
50
50
|
# Packs the CRC24 checksum.
|
@@ -73,7 +73,7 @@ module Digest
|
|
73
73
|
#
|
74
74
|
def update(data)
|
75
75
|
data.each_byte do |b|
|
76
|
-
@crc = ((
|
76
|
+
@crc = ((@table[((@crc >> 16) ^ b) & 0xff] ^ (@crc << 8)) & 0xffffff)
|
77
77
|
end
|
78
78
|
|
79
79
|
return self
|
@@ -81,3 +81,7 @@ module Digest
|
|
81
81
|
|
82
82
|
end
|
83
83
|
end
|
84
|
+
|
85
|
+
if RUBY_ENGINE == 'ruby'
|
86
|
+
begin; require 'digest/crc24/crc24_ext'; rescue LoadError; end
|
87
|
+
end
|
data/lib/digest/crc32.rb
CHANGED
@@ -78,7 +78,7 @@ module Digest
|
|
78
78
|
0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf,
|
79
79
|
0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,
|
80
80
|
0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
|
81
|
-
]
|
81
|
+
].freeze
|
82
82
|
|
83
83
|
#
|
84
84
|
# Packs the CRC32 checksum.
|
@@ -108,7 +108,7 @@ module Digest
|
|
108
108
|
#
|
109
109
|
def update(data)
|
110
110
|
data.each_byte do |b|
|
111
|
-
@crc = (
|
111
|
+
@crc = @table[(@crc ^ b) & 0xff] ^ ((@crc >> 8) & 0xffffffff)
|
112
112
|
end
|
113
113
|
|
114
114
|
return self
|
@@ -116,3 +116,7 @@ module Digest
|
|
116
116
|
|
117
117
|
end
|
118
118
|
end
|
119
|
+
|
120
|
+
if RUBY_ENGINE == 'ruby'
|
121
|
+
begin; require 'digest/crc32/crc32_ext'; rescue LoadError; end
|
122
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
require 'digest/crc32'
|
2
|
+
|
3
|
+
module Digest
|
4
|
+
#
|
5
|
+
# Implements the CRC32 BZip2 algorithm
|
6
|
+
#
|
7
|
+
class CRC32BZip2 < CRC32
|
8
|
+
|
9
|
+
# Generated by `./pycrc.py --algorithm=table-driven --model=crc-32-bzip2 --generate=c`
|
10
|
+
TABLE = [
|
11
|
+
0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005,
|
12
|
+
0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61, 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd,
|
13
|
+
0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9, 0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75,
|
14
|
+
0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011, 0x791d4014, 0x7ddc5da3, 0x709f7b7a, 0x745e66cd,
|
15
|
+
0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039, 0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5,
|
16
|
+
0xbe2b5b58, 0xbaea46ef, 0xb7a96036, 0xb3687d81, 0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d,
|
17
|
+
0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49, 0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95,
|
18
|
+
0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1, 0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d,
|
19
|
+
0x34867077, 0x30476dc0, 0x3d044b19, 0x39c556ae, 0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072,
|
20
|
+
0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16, 0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca,
|
21
|
+
0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde, 0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02,
|
22
|
+
0x5e9f46bf, 0x5a5e5b08, 0x571d7dd1, 0x53dc6066, 0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba,
|
23
|
+
0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e, 0xbfa1b04b, 0xbb60adfc, 0xb6238b25, 0xb2e29692,
|
24
|
+
0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6, 0x99a95df3, 0x9d684044, 0x902b669d, 0x94ea7b2a,
|
25
|
+
0xe0b41de7, 0xe4750050, 0xe9362689, 0xedf73b3e, 0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2,
|
26
|
+
0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686, 0xd5b88683, 0xd1799b34, 0xdc3abded, 0xd8fba05a,
|
27
|
+
0x690ce0ee, 0x6dcdfd59, 0x608edb80, 0x644fc637, 0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb,
|
28
|
+
0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f, 0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53,
|
29
|
+
0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47, 0x36194d42, 0x32d850f5, 0x3f9b762c, 0x3b5a6b9b,
|
30
|
+
0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff, 0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623,
|
31
|
+
0xf12f560e, 0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7, 0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b,
|
32
|
+
0xd727bbb6, 0xd3e6a601, 0xdea580d8, 0xda649d6f, 0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, 0xc960ebb3,
|
33
|
+
0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7, 0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b,
|
34
|
+
0x9b3660c6, 0x9ff77d71, 0x92b45ba8, 0x9675461f, 0x8832161a, 0x8cf30bad, 0x81b02d74, 0x857130c3,
|
35
|
+
0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640, 0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c,
|
36
|
+
0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8, 0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24,
|
37
|
+
0x119b4be9, 0x155a565e, 0x18197087, 0x1cd86d30, 0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec,
|
38
|
+
0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088, 0x2497d08d, 0x2056cd3a, 0x2d15ebe3, 0x29d4f654,
|
39
|
+
0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0, 0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, 0xdbee767c,
|
40
|
+
0xe3a1cbc1, 0xe760d676, 0xea23f0af, 0xeee2ed18, 0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4,
|
41
|
+
0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0, 0x9abc8bd5, 0x9e7d9662, 0x933eb0bb, 0x97ffad0c,
|
42
|
+
0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668, 0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4
|
43
|
+
].freeze
|
44
|
+
|
45
|
+
#
|
46
|
+
# Updates the CRC32 BZip2 checksum.
|
47
|
+
#
|
48
|
+
# @param [String] data
|
49
|
+
# The data to update the checksum with.
|
50
|
+
#
|
51
|
+
def update(data)
|
52
|
+
data.each_byte do |b|
|
53
|
+
@crc = (@table[((@crc >> 24) ^ b) & 0xff] ^ (@crc << 8)) & 0xffffffff
|
54
|
+
end
|
55
|
+
|
56
|
+
return self
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
if RUBY_ENGINE == 'ruby'
|
63
|
+
begin; require 'digest/crc32_bzip2/crc32_bzip2_ext'; rescue LoadError; end
|
64
|
+
end
|
data/lib/digest/crc32_mpeg.rb
CHANGED
@@ -4,10 +4,11 @@ module Digest
|
|
4
4
|
#
|
5
5
|
# Implements the CRC32 Mpeg algorithm.
|
6
6
|
#
|
7
|
-
class
|
7
|
+
class CRC32MPEG < CRC32
|
8
8
|
|
9
9
|
XOR_MASK = 0x00000000
|
10
10
|
|
11
|
+
# Generated by `./pycrc.py --algorithm=table-driven --model=crc-32-mpeg --generate=c`
|
11
12
|
TABLE = [
|
12
13
|
0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9,
|
13
14
|
0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005,
|
@@ -73,7 +74,7 @@ module Digest
|
|
73
74
|
0x9abc8bd5, 0x9e7d9662, 0x933eb0bb, 0x97ffad0c,
|
74
75
|
0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668,
|
75
76
|
0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4
|
76
|
-
]
|
77
|
+
].freeze
|
77
78
|
|
78
79
|
#
|
79
80
|
# Updates the CRC32 Mpeg checksum.
|
@@ -83,11 +84,18 @@ module Digest
|
|
83
84
|
#
|
84
85
|
def update(data)
|
85
86
|
data.each_byte do |b|
|
86
|
-
@crc = ((
|
87
|
+
@crc = ((@table[((@crc >> 24) ^ b) & 0xff] ^ (@crc << 8)) & 0xffffffff)
|
87
88
|
end
|
88
89
|
|
89
90
|
return self
|
90
91
|
end
|
91
92
|
|
92
93
|
end
|
94
|
+
|
95
|
+
# @deprecated Please use {CRC32MPEG}.
|
96
|
+
CRC32Mpeg = CRC32MPEG
|
97
|
+
end
|
98
|
+
|
99
|
+
if RUBY_ENGINE == 'ruby'
|
100
|
+
begin; require 'digest/crc32_mpeg/crc32_mpeg_ext'; rescue LoadError; end
|
93
101
|
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
require 'digest/crc32'
|
2
|
+
|
3
|
+
module Digest
|
4
|
+
#
|
5
|
+
# Implements the CRC32 POSIX algorithm.
|
6
|
+
#
|
7
|
+
class CRC32POSIX < CRC32
|
8
|
+
|
9
|
+
INIT_CRC = 0x00000000
|
10
|
+
|
11
|
+
TABLE = [
|
12
|
+
0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005,
|
13
|
+
0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61, 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd,
|
14
|
+
0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9, 0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75,
|
15
|
+
0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011, 0x791d4014, 0x7ddc5da3, 0x709f7b7a, 0x745e66cd,
|
16
|
+
0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039, 0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5,
|
17
|
+
0xbe2b5b58, 0xbaea46ef, 0xb7a96036, 0xb3687d81, 0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d,
|
18
|
+
0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49, 0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95,
|
19
|
+
0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1, 0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d,
|
20
|
+
0x34867077, 0x30476dc0, 0x3d044b19, 0x39c556ae, 0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072,
|
21
|
+
0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16, 0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca,
|
22
|
+
0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde, 0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02,
|
23
|
+
0x5e9f46bf, 0x5a5e5b08, 0x571d7dd1, 0x53dc6066, 0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba,
|
24
|
+
0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e, 0xbfa1b04b, 0xbb60adfc, 0xb6238b25, 0xb2e29692,
|
25
|
+
0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6, 0x99a95df3, 0x9d684044, 0x902b669d, 0x94ea7b2a,
|
26
|
+
0xe0b41de7, 0xe4750050, 0xe9362689, 0xedf73b3e, 0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2,
|
27
|
+
0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686, 0xd5b88683, 0xd1799b34, 0xdc3abded, 0xd8fba05a,
|
28
|
+
0x690ce0ee, 0x6dcdfd59, 0x608edb80, 0x644fc637, 0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb,
|
29
|
+
0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f, 0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53,
|
30
|
+
0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47, 0x36194d42, 0x32d850f5, 0x3f9b762c, 0x3b5a6b9b,
|
31
|
+
0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff, 0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623,
|
32
|
+
0xf12f560e, 0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7, 0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b,
|
33
|
+
0xd727bbb6, 0xd3e6a601, 0xdea580d8, 0xda649d6f, 0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, 0xc960ebb3,
|
34
|
+
0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7, 0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b,
|
35
|
+
0x9b3660c6, 0x9ff77d71, 0x92b45ba8, 0x9675461f, 0x8832161a, 0x8cf30bad, 0x81b02d74, 0x857130c3,
|
36
|
+
0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640, 0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c,
|
37
|
+
0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8, 0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24,
|
38
|
+
0x119b4be9, 0x155a565e, 0x18197087, 0x1cd86d30, 0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec,
|
39
|
+
0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088, 0x2497d08d, 0x2056cd3a, 0x2d15ebe3, 0x29d4f654,
|
40
|
+
0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0, 0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, 0xdbee767c,
|
41
|
+
0xe3a1cbc1, 0xe760d676, 0xea23f0af, 0xeee2ed18, 0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4,
|
42
|
+
0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0, 0x9abc8bd5, 0x9e7d9662, 0x933eb0bb, 0x97ffad0c,
|
43
|
+
0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668, 0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4
|
44
|
+
].freeze
|
45
|
+
|
46
|
+
#
|
47
|
+
# Updates the CRC32 POSIX checksum.
|
48
|
+
#
|
49
|
+
# @param [String] data
|
50
|
+
# The data to update the checksum with.
|
51
|
+
#
|
52
|
+
def update(data)
|
53
|
+
data.each_byte do |b|
|
54
|
+
@crc = (@table[((@crc >> 24) ^ b) & 0xff] ^ (@crc << 8)) & 0xffffffff
|
55
|
+
end
|
56
|
+
|
57
|
+
return self
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
if RUBY_ENGINE == 'ruby'
|
64
|
+
begin; require 'digest/crc32_posix/crc32_posix_ext'; rescue LoadError; end
|
65
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
require 'digest/crc32'
|
2
|
+
|
3
|
+
module Digest
|
4
|
+
#
|
5
|
+
# Implements the CRC32 XFER algorithm.
|
6
|
+
#
|
7
|
+
class CRC32XFER < CRC32
|
8
|
+
|
9
|
+
INIT_CRC = 0x00000000
|
10
|
+
|
11
|
+
XOR_MASK = 0x00000000
|
12
|
+
|
13
|
+
# Generated by `./pycrc.py --algorithm=table-driven --model=xfer --generate=c`
|
14
|
+
TABLE = [
|
15
|
+
0x00000000, 0x000000af, 0x0000015e, 0x000001f1, 0x000002bc, 0x00000213, 0x000003e2, 0x0000034d,
|
16
|
+
0x00000578, 0x000005d7, 0x00000426, 0x00000489, 0x000007c4, 0x0000076b, 0x0000069a, 0x00000635,
|
17
|
+
0x00000af0, 0x00000a5f, 0x00000bae, 0x00000b01, 0x0000084c, 0x000008e3, 0x00000912, 0x000009bd,
|
18
|
+
0x00000f88, 0x00000f27, 0x00000ed6, 0x00000e79, 0x00000d34, 0x00000d9b, 0x00000c6a, 0x00000cc5,
|
19
|
+
0x000015e0, 0x0000154f, 0x000014be, 0x00001411, 0x0000175c, 0x000017f3, 0x00001602, 0x000016ad,
|
20
|
+
0x00001098, 0x00001037, 0x000011c6, 0x00001169, 0x00001224, 0x0000128b, 0x0000137a, 0x000013d5,
|
21
|
+
0x00001f10, 0x00001fbf, 0x00001e4e, 0x00001ee1, 0x00001dac, 0x00001d03, 0x00001cf2, 0x00001c5d,
|
22
|
+
0x00001a68, 0x00001ac7, 0x00001b36, 0x00001b99, 0x000018d4, 0x0000187b, 0x0000198a, 0x00001925,
|
23
|
+
0x00002bc0, 0x00002b6f, 0x00002a9e, 0x00002a31, 0x0000297c, 0x000029d3, 0x00002822, 0x0000288d,
|
24
|
+
0x00002eb8, 0x00002e17, 0x00002fe6, 0x00002f49, 0x00002c04, 0x00002cab, 0x00002d5a, 0x00002df5,
|
25
|
+
0x00002130, 0x0000219f, 0x0000206e, 0x000020c1, 0x0000238c, 0x00002323, 0x000022d2, 0x0000227d,
|
26
|
+
0x00002448, 0x000024e7, 0x00002516, 0x000025b9, 0x000026f4, 0x0000265b, 0x000027aa, 0x00002705,
|
27
|
+
0x00003e20, 0x00003e8f, 0x00003f7e, 0x00003fd1, 0x00003c9c, 0x00003c33, 0x00003dc2, 0x00003d6d,
|
28
|
+
0x00003b58, 0x00003bf7, 0x00003a06, 0x00003aa9, 0x000039e4, 0x0000394b, 0x000038ba, 0x00003815,
|
29
|
+
0x000034d0, 0x0000347f, 0x0000358e, 0x00003521, 0x0000366c, 0x000036c3, 0x00003732, 0x0000379d,
|
30
|
+
0x000031a8, 0x00003107, 0x000030f6, 0x00003059, 0x00003314, 0x000033bb, 0x0000324a, 0x000032e5,
|
31
|
+
0x00005780, 0x0000572f, 0x000056de, 0x00005671, 0x0000553c, 0x00005593, 0x00005462, 0x000054cd,
|
32
|
+
0x000052f8, 0x00005257, 0x000053a6, 0x00005309, 0x00005044, 0x000050eb, 0x0000511a, 0x000051b5,
|
33
|
+
0x00005d70, 0x00005ddf, 0x00005c2e, 0x00005c81, 0x00005fcc, 0x00005f63, 0x00005e92, 0x00005e3d,
|
34
|
+
0x00005808, 0x000058a7, 0x00005956, 0x000059f9, 0x00005ab4, 0x00005a1b, 0x00005bea, 0x00005b45,
|
35
|
+
0x00004260, 0x000042cf, 0x0000433e, 0x00004391, 0x000040dc, 0x00004073, 0x00004182, 0x0000412d,
|
36
|
+
0x00004718, 0x000047b7, 0x00004646, 0x000046e9, 0x000045a4, 0x0000450b, 0x000044fa, 0x00004455,
|
37
|
+
0x00004890, 0x0000483f, 0x000049ce, 0x00004961, 0x00004a2c, 0x00004a83, 0x00004b72, 0x00004bdd,
|
38
|
+
0x00004de8, 0x00004d47, 0x00004cb6, 0x00004c19, 0x00004f54, 0x00004ffb, 0x00004e0a, 0x00004ea5,
|
39
|
+
0x00007c40, 0x00007cef, 0x00007d1e, 0x00007db1, 0x00007efc, 0x00007e53, 0x00007fa2, 0x00007f0d,
|
40
|
+
0x00007938, 0x00007997, 0x00007866, 0x000078c9, 0x00007b84, 0x00007b2b, 0x00007ada, 0x00007a75,
|
41
|
+
0x000076b0, 0x0000761f, 0x000077ee, 0x00007741, 0x0000740c, 0x000074a3, 0x00007552, 0x000075fd,
|
42
|
+
0x000073c8, 0x00007367, 0x00007296, 0x00007239, 0x00007174, 0x000071db, 0x0000702a, 0x00007085,
|
43
|
+
0x000069a0, 0x0000690f, 0x000068fe, 0x00006851, 0x00006b1c, 0x00006bb3, 0x00006a42, 0x00006aed,
|
44
|
+
0x00006cd8, 0x00006c77, 0x00006d86, 0x00006d29, 0x00006e64, 0x00006ecb, 0x00006f3a, 0x00006f95,
|
45
|
+
0x00006350, 0x000063ff, 0x0000620e, 0x000062a1, 0x000061ec, 0x00006143, 0x000060b2, 0x0000601d,
|
46
|
+
0x00006628, 0x00006687, 0x00006776, 0x000067d9, 0x00006494, 0x0000643b, 0x000065ca, 0x00006565
|
47
|
+
].freeze
|
48
|
+
|
49
|
+
#
|
50
|
+
# Updates the CRC32 XFER checksum.
|
51
|
+
#
|
52
|
+
# @param [String] data
|
53
|
+
# The data to update the checksum with.
|
54
|
+
#
|
55
|
+
def update(data)
|
56
|
+
data.each_byte do |b|
|
57
|
+
@crc = (@table[((@crc >> 24) ^ b) & 0xff] ^ (@crc << 8)) & 0xffffffff
|
58
|
+
end
|
59
|
+
|
60
|
+
return self
|
61
|
+
end
|
62
|
+
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
if RUBY_ENGINE == 'ruby'
|
67
|
+
begin; require 'digest/crc32_xfer/crc32_xfer_ext'; rescue LoadError; end
|
68
|
+
end
|
data/lib/digest/crc32c.rb
CHANGED
@@ -72,21 +72,11 @@ module Digest
|
|
72
72
|
0x34f4f86a, 0xc69f7b69, 0xd5cf889d, 0x27a40b9e,
|
73
73
|
0x79b737ba, 0x8bdcb4b9, 0x988c474d, 0x6ae7c44e,
|
74
74
|
0xbe2da0a5, 0x4c4623a6, 0x5f16d052, 0xad7d5351
|
75
|
-
]
|
76
|
-
|
77
|
-
#
|
78
|
-
# Updates the CRC32 checksum.
|
79
|
-
#
|
80
|
-
# @param [String] data
|
81
|
-
# The data to update the checksum with.
|
82
|
-
#
|
83
|
-
def update(data)
|
84
|
-
data.each_byte do |b|
|
85
|
-
@crc = (((@crc >> 8) & 0x00ffffff) ^ TABLE[(@crc ^ b) & 0xff])
|
86
|
-
end
|
87
|
-
|
88
|
-
return self
|
89
|
-
end
|
75
|
+
].freeze
|
90
76
|
|
91
77
|
end
|
92
78
|
end
|
79
|
+
|
80
|
+
if RUBY_ENGINE == 'ruby'
|
81
|
+
begin; require 'digest/crc32c/crc32c_ext'; rescue LoadError; end
|
82
|
+
end
|
data/lib/digest/crc5.rb
CHANGED
@@ -32,7 +32,29 @@ module Digest
|
|
32
32
|
0x40, 0x30, 0xa0, 0xd0, 0xc8, 0xb8, 0x28, 0x58, 0x18, 0x68, 0xf8, 0x88, 0x90, 0xe0, 0x70, 0x00,
|
33
33
|
0xd8, 0xa8, 0x38, 0x48, 0x50, 0x20, 0xb0, 0xc0, 0x80, 0xf0, 0x60, 0x10, 0x08, 0x78, 0xe8, 0x98,
|
34
34
|
0x68, 0x18, 0x88, 0xf8, 0xe0, 0x90, 0x00, 0x70, 0x30, 0x40, 0xd0, 0xa0, 0xb8, 0xc8, 0x58, 0x28
|
35
|
-
]
|
35
|
+
].freeze
|
36
|
+
|
37
|
+
#
|
38
|
+
# Initializes the CRC5 instance.
|
39
|
+
#
|
40
|
+
def initialize
|
41
|
+
@crc_mask = self.class.const_get(:CRC_MASK)
|
42
|
+
|
43
|
+
super
|
44
|
+
end
|
45
|
+
|
46
|
+
#
|
47
|
+
# Packs the CRC8 checksum.
|
48
|
+
#
|
49
|
+
# @param [Integer] crc
|
50
|
+
# The checksum to pack.
|
51
|
+
#
|
52
|
+
# @return [String]
|
53
|
+
# The packed checksum.
|
54
|
+
#
|
55
|
+
def self.pack(crc)
|
56
|
+
(crc & CRC_MASK).chr
|
57
|
+
end
|
36
58
|
|
37
59
|
#
|
38
60
|
# Updates the CRC5 checksum.
|
@@ -42,7 +64,7 @@ module Digest
|
|
42
64
|
#
|
43
65
|
def update(data)
|
44
66
|
data.each_byte do |b|
|
45
|
-
@crc = ((
|
67
|
+
@crc = ((@table[((@crc >> 3) ^ b) & 0xff] ^ (@crc >> 8)) & @crc_mask)
|
46
68
|
end
|
47
69
|
|
48
70
|
return self
|
@@ -50,3 +72,7 @@ module Digest
|
|
50
72
|
|
51
73
|
end
|
52
74
|
end
|
75
|
+
|
76
|
+
if RUBY_ENGINE == 'ruby'
|
77
|
+
begin; require 'digest/crc5/crc5_ext'; rescue LoadError; end
|
78
|
+
end
|
data/lib/digest/crc64.rb
CHANGED
@@ -78,7 +78,7 @@ module Digest
|
|
78
78
|
0x9fc0000000000000, 0x9e70000000000000, 0x9ca0000000000000, 0x9d10000000000000,
|
79
79
|
0x9480000000000000, 0x9530000000000000, 0x97e0000000000000, 0x9650000000000000,
|
80
80
|
0x9240000000000000, 0x93f0000000000000, 0x9120000000000000, 0x9090000000000000
|
81
|
-
]
|
81
|
+
].freeze
|
82
82
|
|
83
83
|
#
|
84
84
|
# Packs the CRC64 checksum.
|
@@ -112,7 +112,7 @@ module Digest
|
|
112
112
|
#
|
113
113
|
def update(data)
|
114
114
|
data.each_byte do |b|
|
115
|
-
@crc = ((
|
115
|
+
@crc = ((@table[(@crc ^ b) & 0xff] ^ (@crc >> 8)) & 0xffffffffffffffff)
|
116
116
|
end
|
117
117
|
|
118
118
|
return self
|
@@ -120,3 +120,7 @@ module Digest
|
|
120
120
|
|
121
121
|
end
|
122
122
|
end
|
123
|
+
|
124
|
+
if RUBY_ENGINE == 'ruby'
|
125
|
+
begin; require 'digest/crc64/crc64_ext'; rescue LoadError; end
|
126
|
+
end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
require 'digest/crc64'
|
2
|
+
|
3
|
+
module Digest
|
4
|
+
#
|
5
|
+
# Implements the CRC64 Jones algorithm.
|
6
|
+
#
|
7
|
+
# @since 0.5.0
|
8
|
+
#
|
9
|
+
class CRC64Jones < CRC64
|
10
|
+
|
11
|
+
INIT_XOR = 0xffffffffffffffff
|
12
|
+
|
13
|
+
INIT_CRC = 0x0 ^ INIT_XOR
|
14
|
+
|
15
|
+
# Generated by `./pycrc.py --algorithm=table-driven --model=crc-64-jones --generate=c`
|
16
|
+
TABLE = [
|
17
|
+
0x0000000000000000, 0x7ad870c830358979, 0xf5b0e190606b12f2, 0x8f689158505e9b8b,
|
18
|
+
0xc038e5739841b68f, 0xbae095bba8743ff6, 0x358804e3f82aa47d, 0x4f50742bc81f2d04,
|
19
|
+
0xab28ecb46814fe75, 0xd1f09c7c5821770c, 0x5e980d24087fec87, 0x24407dec384a65fe,
|
20
|
+
0x6b1009c7f05548fa, 0x11c8790fc060c183, 0x9ea0e857903e5a08, 0xe478989fa00bd371,
|
21
|
+
0x7d08ff3b88be6f81, 0x07d08ff3b88be6f8, 0x88b81eabe8d57d73, 0xf2606e63d8e0f40a,
|
22
|
+
0xbd301a4810ffd90e, 0xc7e86a8020ca5077, 0x4880fbd87094cbfc, 0x32588b1040a14285,
|
23
|
+
0xd620138fe0aa91f4, 0xacf86347d09f188d, 0x2390f21f80c18306, 0x594882d7b0f40a7f,
|
24
|
+
0x1618f6fc78eb277b, 0x6cc0863448deae02, 0xe3a8176c18803589, 0x997067a428b5bcf0,
|
25
|
+
0xfa11fe77117cdf02, 0x80c98ebf2149567b, 0x0fa11fe77117cdf0, 0x75796f2f41224489,
|
26
|
+
0x3a291b04893d698d, 0x40f16bccb908e0f4, 0xcf99fa94e9567b7f, 0xb5418a5cd963f206,
|
27
|
+
0x513912c379682177, 0x2be1620b495da80e, 0xa489f35319033385, 0xde51839b2936bafc,
|
28
|
+
0x9101f7b0e12997f8, 0xebd98778d11c1e81, 0x64b116208142850a, 0x1e6966e8b1770c73,
|
29
|
+
0x8719014c99c2b083, 0xfdc17184a9f739fa, 0x72a9e0dcf9a9a271, 0x08719014c99c2b08,
|
30
|
+
0x4721e43f0183060c, 0x3df994f731b68f75, 0xb29105af61e814fe, 0xc849756751dd9d87,
|
31
|
+
0x2c31edf8f1d64ef6, 0x56e99d30c1e3c78f, 0xd9810c6891bd5c04, 0xa3597ca0a188d57d,
|
32
|
+
0xec09088b6997f879, 0x96d1784359a27100, 0x19b9e91b09fcea8b, 0x636199d339c963f2,
|
33
|
+
0xdf7adabd7a6e2d6f, 0xa5a2aa754a5ba416, 0x2aca3b2d1a053f9d, 0x50124be52a30b6e4,
|
34
|
+
0x1f423fcee22f9be0, 0x659a4f06d21a1299, 0xeaf2de5e82448912, 0x902aae96b271006b,
|
35
|
+
0x74523609127ad31a, 0x0e8a46c1224f5a63, 0x81e2d7997211c1e8, 0xfb3aa75142244891,
|
36
|
+
0xb46ad37a8a3b6595, 0xceb2a3b2ba0eecec, 0x41da32eaea507767, 0x3b024222da65fe1e,
|
37
|
+
0xa2722586f2d042ee, 0xd8aa554ec2e5cb97, 0x57c2c41692bb501c, 0x2d1ab4dea28ed965,
|
38
|
+
0x624ac0f56a91f461, 0x1892b03d5aa47d18, 0x97fa21650afae693, 0xed2251ad3acf6fea,
|
39
|
+
0x095ac9329ac4bc9b, 0x7382b9faaaf135e2, 0xfcea28a2faafae69, 0x8632586aca9a2710,
|
40
|
+
0xc9622c4102850a14, 0xb3ba5c8932b0836d, 0x3cd2cdd162ee18e6, 0x460abd1952db919f,
|
41
|
+
0x256b24ca6b12f26d, 0x5fb354025b277b14, 0xd0dbc55a0b79e09f, 0xaa03b5923b4c69e6,
|
42
|
+
0xe553c1b9f35344e2, 0x9f8bb171c366cd9b, 0x10e3202993385610, 0x6a3b50e1a30ddf69,
|
43
|
+
0x8e43c87e03060c18, 0xf49bb8b633338561, 0x7bf329ee636d1eea, 0x012b592653589793,
|
44
|
+
0x4e7b2d0d9b47ba97, 0x34a35dc5ab7233ee, 0xbbcbcc9dfb2ca865, 0xc113bc55cb19211c,
|
45
|
+
0x5863dbf1e3ac9dec, 0x22bbab39d3991495, 0xadd33a6183c78f1e, 0xd70b4aa9b3f20667,
|
46
|
+
0x985b3e827bed2b63, 0xe2834e4a4bd8a21a, 0x6debdf121b863991, 0x1733afda2bb3b0e8,
|
47
|
+
0xf34b37458bb86399, 0x8993478dbb8deae0, 0x06fbd6d5ebd3716b, 0x7c23a61ddbe6f812,
|
48
|
+
0x3373d23613f9d516, 0x49aba2fe23cc5c6f, 0xc6c333a67392c7e4, 0xbc1b436e43a74e9d,
|
49
|
+
0x95ac9329ac4bc9b5, 0xef74e3e19c7e40cc, 0x601c72b9cc20db47, 0x1ac40271fc15523e,
|
50
|
+
0x5594765a340a7f3a, 0x2f4c0692043ff643, 0xa02497ca54616dc8, 0xdafce7026454e4b1,
|
51
|
+
0x3e847f9dc45f37c0, 0x445c0f55f46abeb9, 0xcb349e0da4342532, 0xb1eceec59401ac4b,
|
52
|
+
0xfebc9aee5c1e814f, 0x8464ea266c2b0836, 0x0b0c7b7e3c7593bd, 0x71d40bb60c401ac4,
|
53
|
+
0xe8a46c1224f5a634, 0x927c1cda14c02f4d, 0x1d148d82449eb4c6, 0x67ccfd4a74ab3dbf,
|
54
|
+
0x289c8961bcb410bb, 0x5244f9a98c8199c2, 0xdd2c68f1dcdf0249, 0xa7f41839ecea8b30,
|
55
|
+
0x438c80a64ce15841, 0x3954f06e7cd4d138, 0xb63c61362c8a4ab3, 0xcce411fe1cbfc3ca,
|
56
|
+
0x83b465d5d4a0eece, 0xf96c151de49567b7, 0x76048445b4cbfc3c, 0x0cdcf48d84fe7545,
|
57
|
+
0x6fbd6d5ebd3716b7, 0x15651d968d029fce, 0x9a0d8ccedd5c0445, 0xe0d5fc06ed698d3c,
|
58
|
+
0xaf85882d2576a038, 0xd55df8e515432941, 0x5a3569bd451db2ca, 0x20ed197575283bb3,
|
59
|
+
0xc49581ead523e8c2, 0xbe4df122e51661bb, 0x3125607ab548fa30, 0x4bfd10b2857d7349,
|
60
|
+
0x04ad64994d625e4d, 0x7e7514517d57d734, 0xf11d85092d094cbf, 0x8bc5f5c11d3cc5c6,
|
61
|
+
0x12b5926535897936, 0x686de2ad05bcf04f, 0xe70573f555e26bc4, 0x9ddd033d65d7e2bd,
|
62
|
+
0xd28d7716adc8cfb9, 0xa85507de9dfd46c0, 0x273d9686cda3dd4b, 0x5de5e64efd965432,
|
63
|
+
0xb99d7ed15d9d8743, 0xc3450e196da80e3a, 0x4c2d9f413df695b1, 0x36f5ef890dc31cc8,
|
64
|
+
0x79a59ba2c5dc31cc, 0x037deb6af5e9b8b5, 0x8c157a32a5b7233e, 0xf6cd0afa9582aa47,
|
65
|
+
0x4ad64994d625e4da, 0x300e395ce6106da3, 0xbf66a804b64ef628, 0xc5bed8cc867b7f51,
|
66
|
+
0x8aeeace74e645255, 0xf036dc2f7e51db2c, 0x7f5e4d772e0f40a7, 0x05863dbf1e3ac9de,
|
67
|
+
0xe1fea520be311aaf, 0x9b26d5e88e0493d6, 0x144e44b0de5a085d, 0x6e963478ee6f8124,
|
68
|
+
0x21c640532670ac20, 0x5b1e309b16452559, 0xd476a1c3461bbed2, 0xaeaed10b762e37ab,
|
69
|
+
0x37deb6af5e9b8b5b, 0x4d06c6676eae0222, 0xc26e573f3ef099a9, 0xb8b627f70ec510d0,
|
70
|
+
0xf7e653dcc6da3dd4, 0x8d3e2314f6efb4ad, 0x0256b24ca6b12f26, 0x788ec2849684a65f,
|
71
|
+
0x9cf65a1b368f752e, 0xe62e2ad306bafc57, 0x6946bb8b56e467dc, 0x139ecb4366d1eea5,
|
72
|
+
0x5ccebf68aecec3a1, 0x2616cfa09efb4ad8, 0xa97e5ef8cea5d153, 0xd3a62e30fe90582a,
|
73
|
+
0xb0c7b7e3c7593bd8, 0xca1fc72bf76cb2a1, 0x45775673a732292a, 0x3faf26bb9707a053,
|
74
|
+
0x70ff52905f188d57, 0x0a2722586f2d042e, 0x854fb3003f739fa5, 0xff97c3c80f4616dc,
|
75
|
+
0x1bef5b57af4dc5ad, 0x61372b9f9f784cd4, 0xee5fbac7cf26d75f, 0x9487ca0fff135e26,
|
76
|
+
0xdbd7be24370c7322, 0xa10fceec0739fa5b, 0x2e675fb4576761d0, 0x54bf2f7c6752e8a9,
|
77
|
+
0xcdcf48d84fe75459, 0xb71738107fd2dd20, 0x387fa9482f8c46ab, 0x42a7d9801fb9cfd2,
|
78
|
+
0x0df7adabd7a6e2d6, 0x772fdd63e7936baf, 0xf8474c3bb7cdf024, 0x829f3cf387f8795d,
|
79
|
+
0x66e7a46c27f3aa2c, 0x1c3fd4a417c62355, 0x935745fc4798b8de, 0xe98f353477ad31a7,
|
80
|
+
0xa6df411fbfb21ca3, 0xdc0731d78f8795da, 0x536fa08fdfd90e51, 0x29b7d047efec8728
|
81
|
+
].freeze
|
82
|
+
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
if RUBY_ENGINE == 'ruby'
|
87
|
+
begin; require 'digest/crc64_jones/crc64_jones_ext'; rescue LoadError; end
|
88
|
+
end
|