# sha1

Generates a SHA1 hash of a string. Returns a hex-encoded hash string.

```liquid
{% assign hash = "hello world" | sha1 %}
{% log hash %}
```

Output:

```
2aae6c35c94fcfb415dbe95f408b9ce91ee846ed
```

#### Syntax

```liquid
{{ value | sha1 }}
```

| Parameter | Description        |
| --------- | ------------------ |
| `value`   | The string to hash |

#### Return Value

Returns a hex-encoded SHA1 hash string (40 characters).

#### Examples

**Generate a hash for deduplication:**

```liquid
{% assign content_hash = email.body.text | sha1 %}
{% log "Content hash: " | append: content_hash %}
```

**Create a cache key:**

```liquid
{% capture cache_key_input %}{{ product.id }}-{{ product.updated_at }}{% endcapture %}
{% assign cache_key = cache_key_input | sha1 %}
{% log cache_key %}
```

**Generate a unique identifier from combined fields:**

```liquid
{% capture combined %}{{ order.name }}{{ order.email }}{{ order.created_at }}{% endcapture %}
{% assign unique_id = combined | sha1 %}
{% log unique_id %}
```

#### Notes

* Always returns a hex-encoded string (lowercase, 40 characters)
* SHA1 is suitable for checksums and deduplication, but not for security-sensitive operations
* For HMAC-based authentication, use `hmac_sha256` instead
* See also: `hmac_sha256`, `base64_encode`
