mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-23 08:16:17 -04:00
Merge remote-tracking branch 'upstream/esm' into esmconversion
Also removed substitute operation from legacy module
This commit is contained in:
commit
4008dbf38a
48 changed files with 4100 additions and 2523 deletions
|
@ -25,3 +25,35 @@ export const LETTER_DELIM_OPTIONS = ["Space", "Line feed", "CRLF", "Forward slas
|
|||
* Word sequence delimiters.
|
||||
*/
|
||||
export const WORD_DELIM_OPTIONS = ["Line feed", "CRLF", "Forward slash", "Backslash", "Comma", "Semi-colon", "Colon"];
|
||||
|
||||
/**
|
||||
* Input sequence delimiters.
|
||||
*/
|
||||
export const INPUT_DELIM_OPTIONS = ["Line feed", "CRLF", "Space", "Comma", "Semi-colon", "Colon", "Nothing (separate chars)"];
|
||||
|
||||
/**
|
||||
* Split delimiters.
|
||||
*/
|
||||
export const SPLIT_DELIM_OPTIONS = [
|
||||
{name: "Comma", value: ","},
|
||||
{name: "Space", value: " "},
|
||||
{name: "Line feed", value: "\\n"},
|
||||
{name: "CRLF", value: "\\r\\n"},
|
||||
{name: "Semi-colon", value: ";"},
|
||||
{name: "Colon", value: ":"},
|
||||
{name: "Nothing (separate chars)", value: ""}
|
||||
];
|
||||
|
||||
/**
|
||||
* Join delimiters.
|
||||
*/
|
||||
export const JOIN_DELIM_OPTIONS = [
|
||||
{name: "Line feed", value: "\\n"},
|
||||
{name: "CRLF", value: "\\r\\n"},
|
||||
{name: "Space", value: " "},
|
||||
{name: "Comma", value: ","},
|
||||
{name: "Semi-colon", value: ";"},
|
||||
{name: "Colon", value: ":"},
|
||||
{name: "Nothing (join chars)", value: ""}
|
||||
];
|
||||
|
||||
|
|
|
@ -84,9 +84,9 @@ export function toHexFast(data) {
|
|||
* fromHex("0a:14:1e", "Colon");
|
||||
*/
|
||||
export function fromHex(data, delim, byteLen=2) {
|
||||
delim = delim || (data.indexOf(" ") >= 0 ? "Space" : "None");
|
||||
delim = delim || "Auto";
|
||||
if (delim !== "None") {
|
||||
const delimRegex = Utils.regexRep(delim);
|
||||
const delimRegex = delim === "Auto" ? /[^a-f\d]/gi : Utils.regexRep(delim);
|
||||
data = data.replace(delimRegex, "");
|
||||
}
|
||||
|
||||
|
@ -99,6 +99,12 @@ export function fromHex(data, delim, byteLen=2) {
|
|||
|
||||
|
||||
/**
|
||||
* Hexadecimal delimiters.
|
||||
* To Hexadecimal delimiters.
|
||||
*/
|
||||
export const HEX_DELIM_OPTIONS = ["Space", "Comma", "Semi-colon", "Colon", "Line feed", "CRLF", "0x", "\\x", "None"];
|
||||
export const TO_HEX_DELIM_OPTIONS = ["Space", "Comma", "Semi-colon", "Colon", "Line feed", "CRLF", "0x", "\\x", "None"];
|
||||
|
||||
|
||||
/**
|
||||
* From Hexadecimal delimiters.
|
||||
*/
|
||||
export const FROM_HEX_DELIM_OPTIONS = ["Auto"].concat(TO_HEX_DELIM_OPTIONS);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue