mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-10 08:15:00 -04:00
Base64 operations now throw a meaningful error if the alphabet is the wrong length
This commit is contained in:
parent
be0c2de1b9
commit
84b6a775a7
2 changed files with 11 additions and 5 deletions
|
@ -885,17 +885,17 @@ smothering ampersand abreast
|
|||
it("toBase64: editableOption", () => {
|
||||
const result = toBase64("some input", {
|
||||
alphabet: {
|
||||
value: "0-9A-W"
|
||||
value: "0-9A-W+/a-zXYZ="
|
||||
},
|
||||
});
|
||||
assert.strictEqual(result.toString(), "SPI1R1T0");
|
||||
assert.strictEqual(result.toString(), "StXkPI1gRe1sT0==");
|
||||
}),
|
||||
|
||||
it("toBase64: editableOptions key is value", () => {
|
||||
const result = toBase64("some input", {
|
||||
alphabet: "0-9A-W",
|
||||
alphabet: "0-9A-W+/a-zXYZ=",
|
||||
});
|
||||
assert.strictEqual(result.toString(), "SPI1R1T0");
|
||||
assert.strictEqual(result.toString(), "StXkPI1gRe1sT0==");
|
||||
}),
|
||||
|
||||
it("toBase64: editableOptions default", () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue