Exemple #1
0
        private int md5Check()
        {
            Md5 hasher = new Md5();
            byte[] knownResult = {0x5b,0x79,0x3c,0x41,0xd0,0xf5,0x6b,0xa2,0x2f,0x8b,0x84,0x3b,0x32,0x89,0xc1,0x32};
            string testString = "yummy!";
            byte[] testArray = StringUtils.stringToBytes(testString);
            byte[] md5 = hasher.digest(testArray);

            if (!ArrayUtils.equal(knownResult, md5))
            {
                Console.Write("Failed\n");
                return 0;
            }
            Output.Write("OK\n");
            return 1;
        }