---
id: "sha1hash"
kind: "datatype"
status: "stable"
is_pii: false
categories: ["cryptography", "software"]
langs: ["common"]
aliases: ["sha1"]
quality: 95
url: "http://registry.apicrafter.io/datatype/sha1hash"
---

# SHA-1 hash (`sha1hash`)

Digest of the SHA-1 hash function (160 bits), used for example as a Git object id or a file checksum. SHA-1 is no longer considered collision-resistant. It is written as 40 hexadecimal digits. SHA-1 and RIPEMD-160 digests have the same length, so the value alone does not tell them apart: use the field name or context.

- Parent datatype: `hash`
- Personal data (PII): no
- Categories: Cryptographic identifiers (cryptography), Software development (software)
- Countries: global
- Languages: Common to most languages (common)
- Classification: identifier
- Former IDs: `sha1`

## Detection

Regular expression (Python `re`):

```
^[0-9a-fA-F]{40}$
```

## Examples

- `da39a3ee5e6b4b0d3255bfef95601890afd80709` — SHA-1 hash of the empty string
- `a9993e364706816aba3e25717850c26c9cd0d89d` — SHA-1 hash of the string 'abc'
- `da39a3ee5e6b4b0d3255bfef95601890afd8070` (invalid example) — one hex digit short (39 instead of 40)

## Mappings

- autotype: `SHA1_correct`
- fta: `HASH.SHA1_HEX`

## Metacrafter rules

3 rules: 1 match the field name, 2 match values.

- `sha1hash` (data, `basic/crypto.yaml`)
- `sha1hash_by_field` (field, `basic/crypto.yaml`)
- `sha1hashbyvalue` (data, `common/software.yaml`)

## Supported by tools

- `autotype`
- `fta`
- `greatexpectations`
- `metacrafter`
- `metacrafterpro`

## Sources

- wikipedia: <https://en.wikipedia.org/wiki/SHA-1>
- doc: <https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf>

## Quality

Score 95/100. Missing: translation.

JSON: <http://registry.apicrafter.io/api/v1/datatypes/sha1hash.json> · Edit: <https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/any/cryptography/sha1hash.yaml>
