Ejemplo n.º 1
0
        public Rotor(FixedMechanicRotor rot)
        {
            this.permutation = rot.Permutation.ToUpper().ToCharArray();
            this.knocker     = rot.Knocker;

            this.reverse = new char[26];
            for (int i = 0; i < permutation.Length; i++)
            {
                int revIndex = permutation[i] - 'A';
                reverse[revIndex] = (char)('A' + i);
            }
        }
Ejemplo n.º 2
0
        public Rotor(FixedMechanicRotor rot)
        {
            this.permutation = rot.Permutation.ToUpper().ToCharArray();
            this.knocker = rot.Knocker;

            this.reverse = new char[26];
            for (int i = 0; i < permutation.Length; i++)
            {
                int revIndex = permutation[i] - 'A';
                reverse[revIndex] = (char)('A' + i);
            }
        }