---
title: digest.hash_sha1
summary: null
url: >-
  https://www.fastly.com/documentation/reference/vcl/functions/cryptographic/digest-hash-sha1
---

```
STRING digest.hash_sha1(STRING s)
```

**Available in:** all subroutines

Returns a SHA-1 cryptographic hash for the string `s`. SHA-1 has known
attacks reducing its strength by over half and should not be considered
a strong cryptographic hash function.

## Example

```vcl
declare local var.hash_sha1 STRING;
set var.hash_sha1 = digest.hash_sha1("123456789");
# var.hash_sha1 is now "f7c3bc1d808e04732adf679965ccc34ca7ae3441"
```
