mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 14:56:19 -04:00
fix 956 import operations
This commit is contained in:
parent
007224c92e
commit
2ff4d18685
2 changed files with 28 additions and 1 deletions
|
@ -66,7 +66,7 @@ export function removeSubheadingsFromArray(array) {
|
||||||
* @param str
|
* @param str
|
||||||
*/
|
*/
|
||||||
export function sanitise(str) {
|
export function sanitise(str) {
|
||||||
return str.replace(/ /g, "").toLowerCase();
|
return str.replace(/[/\s.-]/g, "").toLowerCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -357,6 +357,33 @@ TestRegister.addApiTests([
|
||||||
assert.strictEqual(result.toString(), "begin_something_aaaaaaaaaaaaaa_end_something");
|
assert.strictEqual(result.toString(), "begin_something_aaaaaaaaaaaaaa_end_something");
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
it("chef.bake: should accept operation names from Chef Website which contain forward slash", () => {
|
||||||
|
const result = chef.bake("I'll have the test salmon", [
|
||||||
|
{ "op": "Find / Replace",
|
||||||
|
"args": [{ "option": "Regex", "string": "test" }, "good", true, false, true, false]}
|
||||||
|
]);
|
||||||
|
assert.strictEqual(result.toString(), "I'll have the good salmon");
|
||||||
|
}),
|
||||||
|
|
||||||
|
it("chef.bake: should accept operation names from Chef Website which contain a hyphen", () => {
|
||||||
|
const result = chef.bake("I'll have the test salmon", [
|
||||||
|
{ "op": "Adler-32 Checksum",
|
||||||
|
"args": [] }
|
||||||
|
]);
|
||||||
|
assert.strictEqual(result.toString(), "6e4208f8");
|
||||||
|
}),
|
||||||
|
|
||||||
|
it("chef.bake: should accept operation names from Chef Website which contain a period", () => {
|
||||||
|
const result = chef.bake("30 13 02 01 05 16 0e 41 6e 79 62 6f 64 79 20 74 68 65 72 65 3f", [
|
||||||
|
{ "op": "Parse ASN.1 hex string",
|
||||||
|
"args": [0, 32] }
|
||||||
|
]);
|
||||||
|
assert.strictEqual(result.toString(), `SEQUENCE
|
||||||
|
INTEGER 05..(total 1bytes)..05
|
||||||
|
IA5String 'Anybody there?'
|
||||||
|
`);
|
||||||
|
}),
|
||||||
|
|
||||||
it("Excluded operations: throw a sensible error when you try and call one", () => {
|
it("Excluded operations: throw a sensible error when you try and call one", () => {
|
||||||
try {
|
try {
|
||||||
chef.fork();
|
chef.fork();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue