Пример #1
0
        private static void Main(string[] args)
        {
            var key      = new Readable("ICE");
            var input    = new Readable("Burning \'em, if you ain\'t quick and nimble\nI go crazy when I hear a cymbal");
            var expected =
                new Hex("0b3637272a2b2e63622c2e69692a23693a2a3c6324202d623d63343c2a26226324272765272a282b2f20430a652e2c652a3124333a653e2b2027630c692b20283165286326302e27282f");

            Console.WriteLine($"Encoded:  {EncodeMultiXOr(input.GetASCIIBytes(), key.GetASCIIBytes())}");
            Console.WriteLine($"Expected: {expected}");
        }
Пример #2
0
        public void ShouldGive37AsHammingDistance()
        {
            var first    = new Readable("this is a test");
            var second   = new Readable("wokka wokka!!!");
            var expected = 37;

            var answer = Task6.Program.HammingDistance(first.GetASCIIBytes(), second.GetASCIIBytes());

            Assert.Equal(expected, answer);
        }