We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 214b449 commit 0075b9bCopy full SHA for 0075b9b
SabreTools.Hashing.Test/SpamSumTests.cs
@@ -42,4 +42,4 @@ public void FuzzyCompareTest(string? stringOne, string? stringTwo, int expected)
42
Assert.Equal(expected, result);
43
}
44
45
-}
+}
SabreTools.Hashing.Test/TestHelper.cs
@@ -6,7 +6,7 @@ namespace SabreTools.Hashing.Test
6
/// <summary>
7
/// Helper class for tests
8
/// </summary>
9
- /// CRC values confirmed with <see href="https://emn178.github.io/online-tools/crc/"/>
+ /// CRC values confirmed with <see href="https://emn178.github.io/online-tools/crc/"/>
10
internal static class TestHelper
11
{
12
#region Known File Information
@@ -143,6 +143,7 @@ internal static class TestHelper
143
{HashType.CRC32_BZIP2, "18aa4603"},
144
{HashType.CRC32_CDROMEDC, "b8ced467"},
145
{HashType.CRC32_CKSUM, "f27b3c27"},
146
+ {HashType.CRC32_DVDROMEDC, "b538afc0"},
147
{HashType.CRC32_ISCSI, "544d37db"},
148
{HashType.CRC32_ISOHDLC, "ba02a660"},
149
{HashType.CRC32_JAMCRC, "45fd599f"},
@@ -244,4 +245,4 @@ public static void ValidateHash(HashType hashType, string? hashValue)
244
245
public static void ValidateSize(long fileSize)
246
=> Assert.Equal(_hashFileSize, fileSize);
247
248
SabreTools.Hashing/Checksum/StandardDefinitions.cs
@@ -1481,6 +1481,20 @@ public static class StandardDefinitions
1481
XorOut = 0xffffffff,
1482
};
1483
1484
+ /// <summary>
1485
+ /// CRC-32/DVD-ROM-EDC
1486
+ /// </summary>
1487
+ public static readonly CrcDefinition CRC32_DVDROMEDC = new()
1488
+ {
1489
+ Name = "CRC-32/DVD-ROM-EDC",
1490
+ Width = 32,
1491
+ Poly = 0x80000011,
1492
+ Init = 0x00000000,
1493
+ ReflectIn = false,
1494
+ ReflectOut = false,
1495
+ XorOut = 0x00000000,
1496
+ };
1497
+
1498
1499
/// CRC-32/ISCSI
1500
SabreTools.Hashing/Extensions.cs
@@ -138,6 +138,7 @@ public static class Extensions
138
HashType.CRC32_BZIP2 => "BZIP2",
139
HashType.CRC32_CDROMEDC => "CRC-32/CD-ROM-EDC",
140
HashType.CRC32_CKSUM => "CRC-32/CKSUM",
141
+ HashType.CRC32_DVDROMEDC => "CRC-32/DVD-ROM-EDC",
142
HashType.CRC32_ISCSI => "CRC-32/ISCSI",
HashType.CRC32_ISOHDLC => "CRC-32/ISO-HDLC",
HashType.CRC32_JAMCRC => "CRC-32/JAMCRC",
@@ -364,6 +365,7 @@ public static class Extensions
364
365
"crc32_bzip2" => HashType.CRC32_BZIP2,
366
"crc32_cdromedc" => HashType.CRC32_CDROMEDC,
367
"crc32_cksum" => HashType.CRC32_CKSUM,
368
+ "crc32_dvdromedc" => HashType.CRC32_DVDROMEDC,
369
"crc32_iscsi" => HashType.CRC32_ISCSI,
370
"crc32_isohdlc" => HashType.CRC32_ISOHDLC,
371
"crc32_jamcrc" => HashType.CRC32_JAMCRC,
SabreTools.Hashing/HashType.cs
@@ -615,6 +615,11 @@ public enum HashType
615
616
CRC32_CKSUM,
617
618
619
+ /// CRC 32-bit checksum (CRC-32/DVD-ROM-EDC)
620
621
+ CRC32_DVDROMEDC,
622
623
624
/// CRC 32-bit checksum (CRC-32/ISCSI)
625
SabreTools.Hashing/HashWrapper.cs
@@ -208,6 +208,7 @@ private void GetHasher()
208
HashType.CRC32_BZIP2 => new Crc(StandardDefinitions.CRC32_BZIP2),
209
HashType.CRC32_CDROMEDC => new Crc(StandardDefinitions.CRC32_CDROMEDC),
210
HashType.CRC32_CKSUM => new Crc(StandardDefinitions.CRC32_CKSUM),
211
+ HashType.CRC32_DVDROMEDC => new Crc(StandardDefinitions.CRC32_DVDROMEDC),
212
HashType.CRC32_ISCSI => new Crc(StandardDefinitions.CRC32_ISCSI),
213
HashType.CRC32_ISOHDLC => new Crc(StandardDefinitions.CRC32_ISOHDLC),
214
HashType.CRC32_JAMCRC => new Crc(StandardDefinitions.CRC32_JAMCRC),
SabreTools.Hashing/ZeroHash.cs
@@ -221,6 +221,7 @@ public static class ZeroHash
221
{HashType.CRC32_BZIP2, [0x00, 0x00, 0x00, 0x00]},
222
{HashType.CRC32_CDROMEDC, [0x00, 0x00, 0x00, 0x00]},
223
{HashType.CRC32_CKSUM, [0xff, 0xff, 0xff, 0xff]},
224
+ {HashType.CRC32_DVDROMEDC, [0x00, 0x00, 0x00, 0x00]},
225
{HashType.CRC32_ISCSI, [0x00, 0x00, 0x00, 0x00]},
226
{HashType.CRC32_ISOHDLC, [0x00, 0x00, 0x00, 0x00]},
227
{HashType.CRC32_JAMCRC, [0xff, 0xff, 0xff, 0xff]},
@@ -523,6 +524,7 @@ public static class ZeroHash
523
524
{HashType.CRC32_BZIP2, "00000000"},
525
{HashType.CRC32_CDROMEDC, "00000000"},
526
{HashType.CRC32_CKSUM, "ffffffff"},
527
+ {HashType.CRC32_DVDROMEDC, "00000000"},
528
{HashType.CRC32_ISCSI, "00000000"},
529
{HashType.CRC32_ISOHDLC, "00000000"},
530
{HashType.CRC32_JAMCRC, "ffffffff"},
0 commit comments