# 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`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.datajet-app.com/liquid/filters/sha1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
