Пример #1
0
        public void ByteArrayStartsWith5ZeroesTest(byte a, byte b, byte c, byte d, bool expected)
        {
            var cracker = new Cracker();
            var result  = cracker.StartsWith5Zeroes(new[] { a, b, c, d });

            Assert.Equal(expected, result);
        }
Пример #2
0
        public void TestPart1()
        {
            var cracker  = new Cracker();
            var password = cracker.GeneratePassword1("abc", 8);

            Assert.Equal("18f47a30", password);
        }
Пример #3
0
        public void TestHashValidation(string input, bool expected)
        {
            var cracker = new Cracker();
            var hash    = _md5.ComputeHash(Encoding.ASCII.GetBytes(input));
            var isValid = cracker.StartsWith5Zeroes(hash);

            Assert.Equal(expected, isValid);
        }
Пример #4
0
        public static void Main()
        {
            var cracker = new Cracker();

            //cracker.GeneratePassword1("ugkcyxxp", 8);
            cracker.GeneratePassword2("ugkcyxxp", 8);
            //cracker.GeneratePassword2("abc", 8);
        }