mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 23:06:16 -04:00
Bombe: review, tests, validation
This commit is contained in:
parent
b6eb4e84e4
commit
ad6e30f3d4
5 changed files with 173 additions and 31 deletions
|
@ -103,8 +103,8 @@ export class Rotor {
|
|||
if (!/^[A-Z]$/.test(initialPosition)) {
|
||||
throw new OperationError("Rotor initial position must be exactly one uppercase letter");
|
||||
}
|
||||
this.map = new Array(26).fill();
|
||||
this.revMap = new Array(26).fill();
|
||||
this.map = new Array(26);
|
||||
this.revMap = new Array(26);
|
||||
const uniq = {};
|
||||
for (let i=0; i<LETTERS.length; i++) {
|
||||
const a = a2i(LETTERS[i]);
|
||||
|
@ -235,7 +235,7 @@ export class Reflector extends PairMapBase {
|
|||
if (s !== 26) {
|
||||
throw new OperationError("Reflector must have exactly 13 pairs covering every letter");
|
||||
}
|
||||
const optMap = new Array(26).fill();
|
||||
const optMap = new Array(26);
|
||||
for (const x of Object.keys(this.map)) {
|
||||
optMap[x] = this.map[x];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue