---
title: "hash function in Strata | Oplema"
description: "Calculate a UBIGINT hash of one or more values, useful for grouping or comparing rows. Write it as hash(value, ...) in a Strata Formula or Filter."
url: "https://oplema.com/docs/strata/functions/hash"
updated: "2026-11-04"
---

# hash

Calculate a numeric hash of one or more values. It isn't a cryptographic hash, so don't use it for security.

## Try an expression

In [Formula](https://oplema.com/docs/strata/prep/formula), enter the expression and set Output type to **VARCHAR**.

### Expression

```
hash('🦆')
```

### Result

```
'4164431626903154684'
```

The expression returns `UBIGINT`. Formula stores it as `VARCHAR` in this example. To use your own data, replace the example values with column names. Keep format strings and other options as written.

Try it live in Formula

Result
| id | result |
| --- | --- |
| 1 | 4164431626903154684 |

## Arguments and types

```
hash(value, ...)
```

**value**

Any value

Supported signatures (1)

```
hash(value: ANY, ...: ANY) → UBIGINT
```

The result type can depend on the input types. See DuckDB for the full argument rules.

## Things to know

Hash results can change between DuckDB versions; avoid treating them as permanent identifiers.

### With a missing first argument

```
hash(NULL::VARCHAR)
```

'13787848793156543929'

## Related functions

[greatest

Return the largest of its arguments, ignoring missing values. Text is compared by character, so lowercase letters count as larger than uppercase letters.

](https://oplema.com/docs/strata/functions/greatest)[least

Return the smallest of its arguments, ignoring missing values. Text is compared by character, so uppercase letters count as smaller than lowercase letters.

](https://oplema.com/docs/strata/functions/least)[sha1

Returns a VARCHAR with the SHA-1 hash of the value.

](https://oplema.com/docs/strata/functions/sha1)[sha256

Calculate the SHA-256 hash of text or binary data, returned as hexadecimal text.

](https://oplema.com/docs/strata/functions/sha256)

[Browse text](https://oplema.com/docs/strata/functions#text) [DuckDB documentation](https://duckdb.org/docs/current/sql/functions/text.html#hashvalue)

Function metadata from DuckDB, used under the [MIT license](https://github.com/duckdb/duckdb/blob/v1.5.4/LICENSE).
