---
title: "SHA1"
description: "The SHA1 SQL function calculates hash value for parameter according to SHA1 algorithm."
language: en
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/sha1
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/sha1
updated: 2026-08-09T00:00:00Z
license: https://documentation.invantive.eu/en/
---

## Syntax
```mermaid
%%{init: {
  'theme': 'base',
  'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
  'themeVariables': {
    'fontSize': '11px',
    'fontFamily': 'Arial'
  }
}}%%
flowchart LR
    Start((START)) --> | | SHA1[SHA1]:::quoted
    SHA1 --> End((END))
```

## Purpose
The `SHA1` SQL function calculates hash value for parameter according to SHA1 algorithm.

See also [[SHA256]], [[SHA384]] and [[SHA512]].

Parameters:
- Value (`varchar2` or `blob`): text or BLOB to calculate SHA1 hash value for.

Returns: Hash value.

## Examples
The following example retrieves the SHA1 hash of `abcde`:
```sql
select sha1('abcde')

----------------------------------------
03de6c570bfe24bfc328ccd7ca46b76eadaf4334
```
The following example returns `null` since the input is `null`:
```sql
select sha1(null)

-------------------

```