# digest.sha1

The `digest.sha1` function returns the SHA-1 digest of a string as lowercase hexadecimal. SHA-1 is
not collision resistant, so use it only where another system already expects it, such as Git
object ids or legacy checksum files. For fingerprints you control, use
[`digest.sha256`](/functions/automation/digest.sha256).

## Usage

```python
digest.sha1(data)
```

## Arguments

- **`data`**
  Required. The string to hash, as bytes.

## Returns

The digest as a 40-character lowercase hexadecimal string.

## Example

### Compute a Git blob id without Git

```python
content = fs.read_file("README.md")
blob = digest.sha1("blob " + str(len(content)) + "\0" + content)
```

## Errors

- A missing argument, or an argument that is not a string, fails with an argument error.

## Related

- [`digest.sha256`](/functions/automation/digest.sha256) for fingerprints and cache keys.
- [Atmos Automation Language](/scripting/language) and the [script step](/steps/type/script)
