* Converts plugboard value to rotor wiring string. * @protected * @param {string} plugboard String with pairs of letters to be swapped * @return {string} Rotor wiring
(plugboard)
| 845 | * @return {string} Rotor wiring |
| 846 | */ |
| 847 | wiringFromPlugboardValue (plugboard) { |
| 848 | const wiring = alphabet.split('') |
| 849 | plugboard.split(' ').forEach(pair => { |
| 850 | wiring[pair.charCodeAt(0) - 97] = pair[1] |
| 851 | wiring[pair.charCodeAt(1) - 97] = pair[0] |
| 852 | }) |
| 853 | return wiring.join('') |
| 854 | } |
| 855 | |
| 856 | /** |
| 857 | * Returns true, if the brick input is randomizable. |
no test coverage detected