mirror of
https://github.com/gchq/CyberChef
synced 2025-01-07 18:18:47 +00:00
Fix error when decoding a text with 2+ whitespaces in AMNZ mode
This commit is contained in:
parent
d36cede0c7
commit
282f02f4d5
1 changed files with 7 additions and 3 deletions
|
@ -77,10 +77,14 @@ class BaconCipherDecode extends Operation {
|
|||
}
|
||||
});
|
||||
} else if (translation === BACON_TRANSLATION_AMNZ) {
|
||||
const words = input.split(" ");
|
||||
const words = input.split(/\s+/);
|
||||
const letters = words.map(function (e) {
|
||||
const code = e[0].toUpperCase().charCodeAt(0);
|
||||
return code >= "N".charCodeAt(0) ? "1" : "0";
|
||||
if (e) {
|
||||
const code = e[0].toUpperCase().charCodeAt(0);
|
||||
return code >= "N".charCodeAt(0) ? "1" : "0";
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
});
|
||||
input = letters.join("");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue