# Hamming Distance

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. Hamming Distance lives in the **Utils** category of the `fx` menu.

## Parameters

| Parameter  | Type   | Required | Default      | Description                                            |
| ---------- | ------ | -------- | ------------ | ------------------------------------------------------ |
| Input      | string | yes      | —            | Value to transform. Previous step output or a literal. |
| Delimiter  | string | no       | `\n\n`       | Argument value for this operation.                     |
| Unit       | string | no       | `Byte`       | Choose one of: `Byte`, `Bit`.                          |
| Input type | string | no       | `Raw string` | Choose one of: `Raw string`, `Hex`.                    |

`Input` is the primary value (previous step output or a literal).

## Returned value

| Type     | Description                                    |
| -------- | ---------------------------------------------- |
| `string` | Result of the Hamming Distance transformation. |

## Example

<details>
<summary>Run Hamming Distance</summary>

In information theory, the Hamming distance between two strings of equal length is the number of positions at which the corresponding symbols are different. Adjust optional parameters when the defaults do not match your payload.

1. Set **Input** to the value to transform (previous step output or a literal).

2. Review **Delimiter**, **Unit**, **Input type** and keep defaults unless your format requires otherwise.

3. Confirm **Output value** shows the transformed result.

</details>
