For the sake of backwards compatibility, a boolean is passed to tell the key extraction function that an error should be thrown on invalid input.

This commit is contained in:
Ryan Chernoff 2025-04-21 15:05:49 -04:00
parent d3f943bee4
commit 1a6d238537

View file

@ -54,7 +54,7 @@ class XOR extends Operation {
run(input, args) {
input = new Uint8Array(input);
try {
const key = Utils.convertToByteArray(args[0].string || "", args[0].option),
const key = Utils.convertToByteArray(args[0].string || "", args[0].option, true),
[, scheme, nullPreserving] = args;
return bitOp(input, key, xor, nullPreserving, scheme);