mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 14:56:19 -04:00
Converted substitute operation, added tests & moved to OperationError
This commit is contained in:
parent
350d10d98b
commit
2d6a56343b
8 changed files with 125 additions and 12 deletions
|
@ -6,7 +6,7 @@
|
|||
|
||||
import Operation from "../Operation";
|
||||
import { genPolybiusSquare } from "../lib/Ciphers";
|
||||
|
||||
import OperationError from "../errors/OperationError";
|
||||
/**
|
||||
* Bifid Cipher Decode operation
|
||||
*/
|
||||
|
@ -48,7 +48,7 @@ class BifidCipherDecode extends Operation {
|
|||
trans = "";
|
||||
|
||||
if (!/^[A-Z]+$/.test(keywordStr) && keyword.length > 0)
|
||||
return "The key must consist only of letters in the English alphabet";
|
||||
throw new OperationError("The key must consist only of letters in the English alphabet");
|
||||
|
||||
const polybius = genPolybiusSquare(keywordStr);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue