mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-23 16:26:16 -04:00
Base64 operations now throw a meaningful error if the alphabet is the wrong length
This commit is contained in:
parent
3472484601
commit
834ff95702
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