Exemple #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);
            }
        }
Exemple #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);
            }
        }