---
schema_version: "1"
id: 063246186868567997d1e168cac0666a1da5e3c0dc6b242a61c523304425019b
title: "Handlebars Helper Function: sha1"
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/handlebars/reference/encryption/mcn-handlebars-reference-encryption-sha1.md
canonical_url: https://developer.salesforce.com/docs/marketing/handlebars-for-marketing-cloud-next/references/mcn-handlebars-encryption-references/mcn-handlebars-reference-encryption-sha1.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 7cef86702e8e55d88070b3efc65b4d7d985c39a7550b5287815507c99cfa2ca4
products:
  - Handlebars for Marketing Cloud Next
  - Marketing Cloud
---
# Handlebars Helper Function: sha1

Converts a string to a 160-bit hexadecimal SHA-1 hash.

**note:** SHA-1 is a one-way hash and isn't suitable for securely storing passwords or other sensitive data.

## Availability

This helper is available in the Winter ’27 release of Marketing Cloud Next.

## Syntax

```handlebars
{{sha1 STRING_TO_CONVERT charset=CHARSET}}
```

## Parameters

| Parameter           | Type   | Description                                                                                                               |
| ------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------- |
| `STRING_TO_CONVERT` | String | Required. The string to hash.                                                                                             |
| `charset`           | String | The character set to use. Specify as a named parameter. Accepted values are `UTF-8` and `UTF-16`. The default is `UTF-8`. |

## Return Value

The function returns the 160-bit SHA-1 hash as a hexadecimal string.

## Usage Example

This example hashes a string of text by using UTF-16 character encoding.

```handlebars
{{sha1 "This is a string of text." charset="UTF-16"}}
```

The function returns a hash of the string.

```
1a36453a2f2c1bf17dcc763321e5e35268e5e4c6
```
