示例#1
0
        static void testCustomInput(string input)
        {
            Console.WriteLine("Testing FNV1-Hash with string \"" + input + "\"");
            Console.WriteLine(FNV.fnv1_32Hash(stringToByteArray(input)));

            Console.WriteLine("Testing FNV1A-Hash with string \"" + input + "\"");
            Console.WriteLine(FNV.fnv1A_32Hash(stringToByteArray(input)));

            Console.WriteLine("Testing FNV0-Hash with string \"" + input + "\"");
            Console.WriteLine(FNV.fnv0_32Hash(stringToByteArray(input)) + '\n');

            Console.WriteLine("Testing CRC-Hash with string \"" + input + "\"");
            Console.WriteLine(CRC.crc_32Hash(stringToByteArray(input)));

            Console.WriteLine("Testing CRC-B-Hash with string \"" + input + "\"");
            Console.WriteLine(CRC.crcB_32Hash(stringToByteArray(input)) + '\n');

            Console.WriteLine("Testing Adler-Hash with string \"" + input + "\"");
            Console.WriteLine(Adler.adler_32Hash(stringToByteArray(input)) + '\n');

            Console.WriteLine("Testing MD2-Hash with string \"" + input + "\"");
            Console.WriteLine(MD.md2_128Hash(stringToByteArray(input)));

            Console.WriteLine("Testing MD4-Hash with string \"" + input + "\"");
            Console.WriteLine(MD.md4_128Hash(stringToByteArray(input)));

            Console.WriteLine("Testing MD5-Hash with string \"" + input + "\"");
            Console.WriteLine(MD.md5_128Hash(stringToByteArray(input)));

            Console.WriteLine("Testing SHA0-Hash with string \"" + input + "\"");
            Console.WriteLine(SHA.sha0_160Hash(stringToByteArray(input)) + '\n');

            Console.WriteLine("Testing SHA1-Hash with string \"" + input + "\"");
            Console.WriteLine(SHA.sha1_160Hash(stringToByteArray(input)) + '\n');

            Console.WriteLine("Testing SHA2-Hash with string \"" + input + "\"");
            Console.WriteLine(SHA.sha2_224Hash(stringToByteArray(input)));
        }
示例#2
0
 public void TestMD5()
 {
     Assert.Equal("C2DF5F7D3132A7920E6B245AB1E58625", MD.md5_128Hash(stringToByteArray("HelloKitty")));
 }