Beispiel #1
0
        public static void Main(string[] args)
        {
            KnotHasher hasher = new KnotHasher();

            OpenInputFile(FileLocation).First()
            .Split(',')
            .Select(byte.Parse)
            .ToList()
            .ForEach(hasher.PinchAndTwist);

            Console.WriteLine(hasher.CalculateAnswer());
        }
Beispiel #2
0
        public static void Main(string[] args)
        {
            KnotHasher hasher = new KnotHasher();

            List <byte> lengthSequence = OpenInputFile(FileLocation)
                                         .First()
                                         .Select(character => (byte)character)
                                         .Append((byte)17).Append((byte)31).Append((byte)73).Append((byte)47).Append((byte)23)
                                         .ToList();

            for (int i = 0; i < 64; i++)
            {
                lengthSequence.ForEach(hasher.PinchAndTwist);
            }

            Console.WriteLine(BitConverter.ToString(hasher.CalculateDenseHash()).Replace("-", ""));
        }