mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-23 00:06:17 -04:00
Add operation to normalise unicode
This commit is contained in:
parent
610d46a1a4
commit
a6fa0628f2
7 changed files with 134 additions and 0 deletions
|
@ -57,6 +57,7 @@ import "./tests/MS.mjs";
|
|||
import "./tests/Magic.mjs";
|
||||
import "./tests/MorseCode.mjs";
|
||||
import "./tests/NetBIOS.mjs";
|
||||
import "./tests/NormaliseUnicode.mjs";
|
||||
import "./tests/OTP.mjs";
|
||||
import "./tests/PGP.mjs";
|
||||
import "./tests/PHP.mjs";
|
||||
|
|
54
tests/operations/tests/NormaliseUnicode.mjs
Normal file
54
tests/operations/tests/NormaliseUnicode.mjs
Normal file
|
@ -0,0 +1,54 @@
|
|||
/**
|
||||
* Text Encoding Brute Force tests.
|
||||
*
|
||||
* @author Matthieu [m@tthieux.xyz]
|
||||
*
|
||||
* @copyright Crown Copyright 2018
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
import TestRegister from "../../lib/TestRegister.mjs";
|
||||
|
||||
TestRegister.addTests([
|
||||
{
|
||||
name: "Normalise Unicode - NFD",
|
||||
input: "\u00c7\u0043\u0327\u2160",
|
||||
expectedMatch: /C\u0327C\u0327\u2160/,
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Normalise Unicode",
|
||||
args: ["NFD"],
|
||||
},
|
||||
],
|
||||
}, {
|
||||
name: "Normalise Unicode - NFC",
|
||||
input: "\u00c7\u0043\u0327\u2160",
|
||||
expectedMatch: /\u00C7\u00C7\u2160/,
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Normalise Unicode",
|
||||
args: ["NFC"],
|
||||
},
|
||||
],
|
||||
}, {
|
||||
name: "Normalise Unicode - NFKD",
|
||||
input: "\u00c7\u0043\u0327\u2160",
|
||||
expectedMatch: /C\u0327C\u0327I/,
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Normalise Unicode",
|
||||
args: ["NFKD"],
|
||||
},
|
||||
],
|
||||
}, {
|
||||
name: "Normalise Unicode - NFKC",
|
||||
input: "\u00c7\u0043\u0327\u2160",
|
||||
expectedMatch: /\u00C7\u00C7\u2160/,
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Normalise Unicode",
|
||||
args: ["NFKC"],
|
||||
},
|
||||
],
|
||||
},
|
||||
]);
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue