mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-24 16:56:15 -04:00
Added 'Hamming Distance' operation.
This commit is contained in:
parent
fa938f832f
commit
1d6bf39548
4 changed files with 94 additions and 0 deletions
|
@ -189,6 +189,7 @@ const Categories = [
|
|||
"Find / Replace",
|
||||
"Regular expression",
|
||||
"Offset checker",
|
||||
"Hamming Distance",
|
||||
"Convert distance",
|
||||
"Convert area",
|
||||
"Convert mass",
|
||||
|
|
|
@ -3913,6 +3913,29 @@ const OperationConfig = {
|
|||
}
|
||||
]
|
||||
},
|
||||
"Hamming Distance": {
|
||||
module: "Default",
|
||||
description: "In information theory, the Hamming distance between two strings of equal length is the number of positions at which the corresponding symbols are different. In other words, it measures the minimum number of substitutions required to change one string into the other, or the minimum number of errors that could have transformed one string into the other. In a more general context, the Hamming distance is one of several string metrics for measuring the edit distance between two sequences.",
|
||||
inputType: "string",
|
||||
outputType: "string",
|
||||
args: [
|
||||
{
|
||||
name: "Delimiter",
|
||||
type: "binaryShortString",
|
||||
value: StrUtils.HAMMING_DELIM
|
||||
},
|
||||
{
|
||||
name: "Unit",
|
||||
type: "option",
|
||||
value: StrUtils.HAMMING_UNIT
|
||||
},
|
||||
{
|
||||
name: "Input type",
|
||||
type: "option",
|
||||
value: StrUtils.HAMMING_INPUT_TYPE
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -110,6 +110,7 @@ OpModules.Default = {
|
|||
"Unescape string": StrUtils.runUnescape,
|
||||
"Head": StrUtils.runHead,
|
||||
"Tail": StrUtils.runTail,
|
||||
"Hamming Distance": StrUtils.runHamming,
|
||||
"Remove whitespace": Tidy.runRemoveWhitespace,
|
||||
"Remove null bytes": Tidy.runRemoveNulls,
|
||||
"Drop bytes": Tidy.runDropBytes,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue