Exemple #1
0
        public void HasherCanCorrectlyGenerate20ByteMediumFileHash()
        {
            ArchivialLibrary.Crypto.Hasher h = new ArchivialLibrary.Crypto.Hasher(new MockLogger());

            byte[] actualHash   = h.Generate20ByteFileHash(".\\TestFiles\\Hasher\\MediumFile.mp3");
            byte[] expectedHash = { 59,   46,  56,  72, 141, 74,  31, 120, 17, 24, 52,
                                    218, 140, 133, 179,  49, 83, 159, 149, 50 };

            Assert.IsTrue(h.CheckTwoByteHashesAreTheSame(actualHash, expectedHash));
        }
Exemple #2
0
        public void HasherCanCorrectlyGenerate20ByteSmallFileHash()
        {
            ArchivialLibrary.Crypto.Hasher h = new ArchivialLibrary.Crypto.Hasher(new MockLogger());

            byte[] actualHash   = h.Generate20ByteFileHash(".\\TestFiles\\Hasher\\SmallFile.txt");
            byte[] expectedHash = { 39,   16,  25, 68, 128, 64, 131, 150, 216, 25,
                                    111, 227, 135, 18, 122, 14, 163,  85, 226, 30 };

            Assert.IsTrue(h.CheckTwoByteHashesAreTheSame(actualHash, expectedHash));
        }