Add integer check for alphabet size (#2458)
Co-authored-by: GCHQDeveloper581 <63102987+GCHQDeveloper581@users.noreply.github.com>
This commit is contained in:
@@ -50,6 +50,14 @@ class GenerateDeBruijnSequence extends Operation {
|
||||
throw new OperationError("Invalid alphabet size, required to be between 2 and 9 (inclusive).");
|
||||
}
|
||||
|
||||
if (!Number.isInteger(k)) {
|
||||
throw new OperationError("Invalid alphabet size, required to be integer.");
|
||||
}
|
||||
|
||||
if (!Number.isInteger(n)) {
|
||||
throw new OperationError("Invalid key length, required to be integer.");
|
||||
}
|
||||
|
||||
if (n < 2) {
|
||||
throw new OperationError("Invalid key length, required to be at least 2.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user