|
1 | | -using System.Diagnostics; |
2 | | -using System.Globalization; |
| 1 | +using System.Globalization; |
3 | 2 | using System.Reflection; |
4 | 3 | using System.Text; |
5 | 4 |
|
@@ -119,15 +118,15 @@ 0x871b1fa0 0x6aa39c80 0xb1d29ac0 0x5c6a19e0 0xea881560 0x07309640 0xdc419000 0x3 |
119 | 118 | 0x5c3d0a20 0xb1858900 0x6af48f40 0x874c0c60 0x31ae00e0 0xdc1683c0 0x07678580 0xeadf06a0 |
120 | 119 | """; |
121 | 120 |
|
122 | | - private static uint[] Table_poly_0x4C11DB7 => __Table_poly_0x4C11DB7_str |
123 | | - .EnumLines() |
124 | | - .SelectMany(line => line.Split(' ')) |
125 | | - .ToArray(s => uint.Parse(s.AsSpan(2), NumberStyles.HexNumber)); |
| 121 | + private static uint[] Table_poly_0x4C11DB7 => __Table_poly_0x4C11DB7_str |
| 122 | + .EnumLines() |
| 123 | + .SelectMany(line => line.Split(' ')) |
| 124 | + .ToArray(s => uint.Parse(s.AsSpan(2), NumberStyles.HexNumber)); |
126 | 125 |
|
127 | | - private static uint[] Table_poly_0xEDB88320_ref_in_out => __Table_poly_0xEDB88320_ref_in_out_str |
128 | | - .EnumLines() |
129 | | - .SelectMany(line => line.Split(' ')) |
130 | | - .ToArray(s => uint.Parse(s.AsSpan(2), NumberStyles.HexNumber)); |
| 126 | + private static uint[] Table_poly_0xEDB88320_ref_in_out => __Table_poly_0xEDB88320_ref_in_out_str |
| 127 | + .EnumLines() |
| 128 | + .SelectMany(line => line.Split(' ')) |
| 129 | + .ToArray(s => uint.Parse(s.AsSpan(2), NumberStyles.HexNumber)); |
131 | 130 |
|
132 | 131 | private static uint[] Table_poly_0xEDB88320 => __Table_poly_0xEDB88320_str |
133 | 132 | .EnumLines() |
@@ -171,21 +170,21 @@ public void ForwardBackward() |
171 | 170 |
|
172 | 171 | static uint CRC_Normal(uint[] table, uint crc, ReadOnlySpan<byte> bytes) |
173 | 172 | { |
174 | | - foreach(var b in bytes) |
| 173 | + foreach (var b in bytes) |
175 | 174 | crc = table[((crc >> 24) ^ b) & 0xFF] ^ (crc << 8); |
176 | 175 | return crc; |
177 | 176 | } |
178 | 177 |
|
179 | 178 | static uint CRC_Ref(uint[] table, uint crc, ReadOnlySpan<byte> bytes) |
180 | 179 | { |
181 | | - foreach(var b in bytes) |
| 180 | + foreach (var b in bytes) |
182 | 181 | crc = table[(crc ^ b) & 0xFF] ^ (crc >> 8); |
183 | 182 | return crc; |
184 | 183 | } |
185 | 184 |
|
186 | 185 | } |
187 | 186 |
|
188 | | - [TestMethod] |
| 187 | + [TestMethod, Ignore] |
189 | 188 | public void TableCheck_POSIX() |
190 | 189 | { |
191 | 190 | // https://github.com/Michaelangel007/crc32 |
|
0 commit comments