2
0
mirror of https://github.com/gchq/CyberChef synced 2025-12-23 03:33:24 +00:00

Tidied 'Generate De Bruijn Sequence' operation

This commit is contained in:
n1474335
2023-03-24 22:39:08 +00:00
parent 0a0217cb66
commit d102e1b15c
2 changed files with 6 additions and 8 deletions

View File

@@ -4,8 +4,8 @@
* @license Apache-2.0
*/
import Operation from "../Operation";
import OperationError from "../errors/OperationError";
import Operation from "../Operation.mjs";
import OperationError from "../errors/OperationError.mjs";
/**
* Generate De Bruijn Sequence operation
@@ -58,9 +58,7 @@ class GenerateDeBruijnSequence extends Operation {
throw new OperationError("Too many permutations, please reduce k^n to under 50,000.");
}
const a = [];
for (let i = 0; i < k * n; i++) a.push(0);
const a = new Array(k * n).fill(0);
const sequence = [];
(function db(t = 1, p = 1) {