# Add a Checksum

The **Add a Checksum** step calculates a checksum for one or more input fields and adds the result to the output stream as a new field.

### Step name

* **Step name**: Specify the unique name of the step on the canvas. You can customize the name or leave it as the default.

### Options

The Add a Checksum step includes the following options:

| Option                          | Description                                                                                                                                                                                                                                                                                                                                                   |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Type**                        | The checksum algorithm to use: CRC32 ([32-bit Cyclic Redundancy Check](http://en.wikipedia.org/wiki/Cyclic_redundancy_check)), ADLER32 ([Adler-32](http://en.wikipedia.org/wiki/Adler-32)), MD5 ([MD5](http://en.wikipedia.org/wiki/MD5)), SHA-1 ([SHA-1](http://en.wikipedia.org/wiki/SHA-1)), or SHA-256 ([SHA-256](http://en.wikipedia.org/wiki/SHA-256)). |
| **Result type**                 | Applies only when you select **Type** = MD5, SHA-1, or SHA-256. Select the output format: **String**, **Hexadecimal**, or **Binary**.                                                                                                                                                                                                                         |
| **Result field**                | The name of the new field that contains the checksum value.                                                                                                                                                                                                                                                                                                   |
| **Compatibility Mode**          | Select for backward compatibility with transformations created before PDI 4.2.0.                                                                                                                                                                                                                                                                              |
| **Old Checksum Behaviour Mode** | Select to treat incoming fields as strings. Clear to treat incoming fields as byte arrays.                                                                                                                                                                                                                                                                    |
| **Fields**                      | The input fields to include in the checksum calculation.                                                                                                                                                                                                                                                                                                      |
| **Get Fields**                  | Populates the **Fields** list from the fields coming into the step.                                                                                                                                                                                                                                                                                           |

{% hint style="info" %}
If you select **Old Checksum Behaviour Mode** and an incoming field is a binary data type, PDI uses the string representation of the byte array.
{% endhint %}

### Example

Your Pentaho distribution includes a CRC32 sample transformation:

```
design-tools/data-integration/samples/transformations/Add a checksum - Basic CRC32 example.ktr
```

### Metadata injection support

All fields in this step support metadata injection. You can use this step with [ETL metadata injection](https://docs.pentaho.com/pdia-data-integration/pdi-transformation-steps-reference-overview/etl-metadata-injection) to pass metadata to your transformation at runtime.
