---
title: Hash Functions reference
meta:
    description: Functions for hashing data.
headingMaxLevels: 2
---

# Hash functions

Hash functions are used to generate a fixed-size output (a hash value) from input data. They are often used for data integrity checks, unique identification, or distributing data across buckets.

`Simhash` is a specific type of hash function that produces similar hash values for similar input arguments, useful for detecting near-duplicate content.

Most hash functions in Tinybird can accept multiple arguments of various data types.

{% callout type="info" %}
A hash of `NULL` is `NULL`. To generate a non-`NULL` hash for a `Nullable` column, wrap the column in a [tuple](../data-types/tuple):

```sql
SELECT cityHash64(tuple(NULL))
```
{% /callout %}

## halfMD5

This function processes all input parameters as strings, computes their MD5 hash, and then combines these hashes. It extracts the first 8 bytes of the resulting hash and interprets them as a `UInt64` value in big-endian order.

### Syntax

```sql
halfMD5(par1, ...)
```

### Arguments

- `par1, ...`: A variable number of input parameters of any [supported data type](../data-types/string). These are implicitly converted to strings for hashing.

### Returns

A 64-bit hash value. [UInt64](../data-types/int-uint).

### Example

```sql
SELECT halfMD5(array('e','x','a'), 'mple', 10, toDateTime('2019-06-15 23:00:00')) AS halfMD5hash, toTypeName(halfMD5hash) AS type
```

Result:

```result
┌────────halfMD5hash─┬─type───┐
│ 186182704141653334 │ UInt64 │
└────────────────────┴────────┘
```

## MD4

Calculates the MD4 hash of a string input.

### Syntax

```sql
MD4(input_string)
```

### Arguments

- `input_string`: The string to hash. [String](../data-types/string).

### Returns

A 128-bit MD4 hash value. [FixedString(16)](../data-types/fixedstring).

### Example

```sql
SELECT MD4('Tinybird') AS md4_hash
```

Result:

```result
┌─md4_hash─────────┐
│ 0000000000000000 │
└──────────────────┘
```

## MD5

Calculates the MD5 hash of a string input.

### Syntax

```sql
MD5(input_string)
```

### Arguments

- `input_string`: The string to hash. [String](../data-types/string).

### Returns

A 128-bit MD5 hash value. [FixedString(16)](../data-types/fixedstring).

### Example

```sql
SELECT MD5('Tinybird') AS md5_hash
```

Result:

```result
┌─md5_hash─────────┐
│ 0000000000000000 │
└──────────────────┘
```

## RIPEMD160

Generates a RIPEMD-160 hash value from a given string.

### Syntax

```sql
RIPEMD160(input)
```

### Arguments

- `input`: The string to hash. [String](../data-types/string).

### Returns

A 160-bit RIPEMD-160 hash value. [FixedString(20)](../data-types/fixedstring).

### Example

Use the [hex](encoding-functions#hex) function to represent the result as a hex-encoded string.

```sql
SELECT HEX(RIPEMD160('The quick brown fox jumps over the lazy dog'))
```

Result:

```result
┌─HEX(RIPEMD160('The quick brown fox jumps over the lazy dog'))─┐
│ 37F332F68DB77BD9D7EDD4969571AD671CF9DD3B                      │
└───────────────────────────────────────────────────────────────┘
```

## sipHash64

Computes a 64-bit SipHash value for one or more input parameters. This cryptographic hash function is generally faster than MD5.

### Syntax

```sql
sipHash64(par1,...)
```

### Arguments

- `par1, ...`: A variable number of input parameters of any [supported data type](../data-types/string). These are implicitly converted to strings for hashing.

### Returns

A 64-bit hash value. [UInt64](../data-types/int-uint).

### Example

```sql
SELECT sipHash64(array('e','x','a'), 'mple', 10, toDateTime('2019-06-15 23:00:00')) AS SipHash, toTypeName(SipHash) AS type
```

Result:

```result
┌──────────────SipHash─┬─type───┐
│ 11400366955626497465 │ UInt64 │
└──────────────────────┴────────┘
```

## sipHash64Keyed

Calculates a 64-bit SipHash value using an explicitly provided key, similar to `sipHash64`.

### Syntax

```sql
sipHash64Keyed((k0, k1), par1,...)
```

### Arguments

- `(k0, k1)`: A [tuple](../data-types/tuple) of two [UInt64](../data-types/int-uint) values that serve as the cryptographic key.
- `par1, ...`: A variable number of input parameters of any [supported data type](../data-types/string).

### Returns

A 64-bit hash value. [UInt64](../data-types/int-uint).

### Example

```sql
SELECT sipHash64Keyed((506097522914230528, 1084818905618843912), array('e','x','a'), 'mple', 10, toDateTime('2019-06-15 23:00:00')) AS SipHash, toTypeName(SipHash) AS type
```

Result:

```result
┌─────────────SipHash─┬─type───┐
│ 8017656310194184311 │ UInt64 │
└─────────────────────┴────────┘
```

## sipHash128

Generates a 128-bit SipHash value, extending the 64-bit version by performing a 128-bit XOR folding of the final state.

{% callout type="info" %}
This 128-bit variant differs from the reference implementation and is considered weaker. For new projects, `sipHash128Reference` is generally recommended.
{% /callout %}

### Syntax

```sql
sipHash128(par1,...)
```

### Arguments

- `par1, ...`: A variable number of input parameters of any [supported data type](../data-types/string).

### Returns

A 128-bit SipHash value. [FixedString(16)](../data-types/fixedstring).

### Example

```sql
SELECT hex(sipHash128('foo', '\x01', 3))
```

Result:

```result
┌─hex(sipHash128('foo', '', 3))────┐
│ 9DE516A64A414D4B1B609415E4523F24 │
└──────────────────────────────────┘
```

## sipHash128Keyed

Calculates a 128-bit SipHash value using an explicit key, similar to `sipHash128`.

{% callout type="info" %}
This 128-bit variant differs from the reference implementation and is considered weaker. For new projects, `sipHash128ReferenceKeyed` is generally recommended.
{% /callout %}

### Syntax

```sql
sipHash128Keyed((k0, k1), par1,...)
```

### Arguments

- `(k0, k1)`: A [tuple](../data-types/tuple) of two [UInt64](../data-types/int-uint) values that serve as the cryptographic key.
- `par1, ...`: A variable number of input parameters of any [supported data type](../data-types/string).

### Returns

A 128-bit SipHash value. [FixedString(16)](../data-types/fixedstring).

### Example

```sql
SELECT hex(sipHash128Keyed((506097522914230528, 1084818905618843912),'foo', '\x01', 3))
```

Result:

```result
┌─hex(sipHash128Keyed((506097522914230528, 1084818905618843912), 'foo', '', 3))─┐
│ B8467F65C8B4CFD9A5F8BD733917D9BF                                              │
└───────────────────────────────────────────────────────────────────────────────┘
```

## sipHash128Reference

Generates a 128-bit SipHash value using the official 128-bit algorithm from the original authors of SipHash.

### Syntax

```sql
sipHash128Reference(par1,...)
```

### Arguments

- `par1, ...`: A variable number of input parameters of any [supported data type](../data-types/string).

### Returns

A 128-bit SipHash value. [FixedString(16)](../data-types/fixedstring).

### Example

```sql
SELECT hex(sipHash128Reference('foo', '\x01', 3))
```

Result:

```result
┌─hex(sipHash128Reference('foo', '', 3))─┐
│ 4D1BE1A22D7F5933C0873E1698426260       │
└────────────────────────────────────────┘
```

## sipHash128ReferenceKeyed

Calculates a 128-bit SipHash value using the official reference algorithm and an explicitly provided key.

### Syntax

```sql
sipHash128ReferenceKeyed((k0, k1), par1,...)
```

### Arguments

- `(k0, k1)`: A [tuple](../data-types/tuple) of two [UInt64](../data-types/int-uint) values that serve as the cryptographic key.
- `par1, ...`: A variable number of input parameters of any [supported data type](../data-types/string).

### Returns

A 128-bit SipHash value. [FixedString(16)](../data-types/fixedstring).

### Example

```sql
SELECT hex(sipHash128ReferenceKeyed((506097522914230528, 1084818905618843912),'foo', '\x01', 3))
```

Result:

```result
┌─hex(sipHash128ReferenceKeyed((506097522914230528, 1084818905618843912), 'foo', '', 3))─┐
│ 630133C9722DC08646156B8130C4CDC8                                                       │
└────────────────────────────────────────────────────────────────────────────────────────┘
```

## cityHash64

Produces a 64-bit CityHash value, a fast non-cryptographic hash function. It uses the CityHash algorithm for string inputs and a specific non-cryptographic hash for other data types, combining results with the CityHash combinator.

### Syntax

```sql
cityHash64(par1,...)
```

### Arguments

- `par1, ...`: A variable number of input parameters of any [supported data type](../data-types/string).

### Returns

A 64-bit hash value. [UInt64](../data-types/int-uint).

### Example

```sql
SELECT cityHash64(array('e','x','a'), 'mple', 10, toDateTime('2019-06-15 23:00:00')) AS CityHash, toTypeName(CityHash) AS type
```

Result:

```result
┌─────────────CityHash─┬─type───┐
│ 12072650598913549138 │ UInt64 │
└──────────────────────┴────────┘
```

## intHash32

Calculates a 32-bit hash code from any integer input. This is a relatively fast, non-cryptographic hash function suitable for numbers.

### Syntax

```sql
intHash32(int)
```

### Arguments

- `int`: The integer value to hash. [(U)Int*](../data-types/int-uint).

### Returns

A 32-bit hash code. [UInt32](../data-types/int-uint).

### Example

```sql
SELECT intHash32(42)
```

Result:

```result
┌─intHash32(42)─┐
│    1228623923 │
└───────────────┘
```

## intHash64

Calculates a 64-bit hash code from any integer input. This non-cryptographic hash function is faster than `intHash32` and provides a higher quality hash for numbers.

### Syntax

```sql
intHash64(int)
```

### Arguments

- `int`: The integer value to hash. [(U)Int*](../data-types/int-uint).

### Returns

A 64-bit hash code. [UInt64](../data-types/int-uint).

### Example

```sql
SELECT intHash64(42)
```

Result:

```result
┌────────intHash64(42)─┐
│ 11490350930367293593 │
└──────────────────────┘
```

## SHA1, SHA224, SHA256, SHA512, SHA512_256

These functions compute various SHA (Secure Hash Algorithm) hashes (SHA-1, SHA-224, SHA-256, SHA-512, SHA-512/256) from a string input.

### Syntax

```sql
SHA1('s')
SHA224('s')
SHA256('s')
SHA512('s')
SHA512_256('s')
```

### Arguments

- `s`: The input string for SHA hash calculation. [String](../data-types/string).

### Returns

The SHA hash as a hex-unencoded [FixedString](../data-types/fixedstring).
- `SHA1`: [FixedString(20)](../data-types/fixedstring)
- `SHA224`: [FixedString(28)](../data-types/fixedstring)
- `SHA256`: [FixedString(32)](../data-types/fixedstring)
- `SHA512`: [FixedString(64)](../data-types/fixedstring)
- `SHA512_256`: [FixedString(32)](../data-types/fixedstring)

### Example

Use the [hex](encoding-functions#hex) function to represent the result as a hex-encoded string.

```sql
SELECT hex(SHA1('abc'))
```

Result:

```result
┌─hex(SHA1('abc'))─────────────────────────┐
│ A9993E364706816ABA3E25717850C26C9CD0D89D │
└──────────────────────────────────────────┘
```

## BLAKE3

Calculates the BLAKE3 hash of a string input. This cryptographic hash function is known for its speed, offering performance approximately twice as fast as SHA-2 while producing hashes of the same length as SHA-256.

### Syntax

```sql
BLAKE3('s')
```

### Arguments

- `s`: The input string for BLAKE3 hash calculation. [String](../data-types/string).

### Returns

The BLAKE3 hash as a byte array. [FixedString(32)](../data-types/fixedstring).

### Example

Use the [hex](encoding-functions#hex) function to represent the result as a hex-encoded string.

```sql
SELECT hex(BLAKE3('ABC'))
```

Result:

```result
┌─hex(BLAKE3('ABC'))───────────────────────────────────────────────┐
│ D1717274597CF0289694F75D96D444B992A096F1AFD8E7BBFA6EBB1D360FEDFC │
└──────────────────────────────────────────────────────────────────┘
```

## URLHash(url[, N])

This function computes a fast, non-cryptographic hash for a URL string after applying some normalization. It can hash the entire URL or up to a specified level in its hierarchy.

### Syntax

```sql
URLHash(url)
URLHash(url, N)
```

### Arguments

- `url`: The URL string to hash. [String](../data-types/string).
- `N`: An optional integer specifying the URL hierarchy level up to which the hash should be calculated. [UInt8](../data-types/int-uint).

### Returns

A hash value. [UInt64](../data-types/int-uint).

### Example

```sql
SELECT URLHash('https://tinybird.co/docs/sql-reference/functions/hash-functions') AS full_url_hash,
       URLHash('https://tinybird.co/docs/sql-reference/functions/hash-functions', 2) AS level_2_hash
```

Result:

```result
┌─full_url_hash──────┬─level_2_hash───────┐
│ 123456789012345678 │ 987654321098765432 │
└────────────────────┴────────────────────┘
```

## farmFingerprint64

This function computes a 64-bit Fingerprint value using the FarmHash algorithm. It is recommended for generating stable and portable hash values.

### Syntax

```sql
farmFingerprint64(par1, ...)
```

### Arguments

- `par1, ...`: A variable number of input parameters of any [supported data type](../data-types/string).

### Returns

A 64-bit hash value. [UInt64](../data-types/int-uint).

### Example

```sql
SELECT farmFingerprint64('Tinybird') AS fingerprint_hash
```

Result:

```result
┌─fingerprint_hash───┐
│ 123456789012345678 │
└────────────────────┘
```

## farmHash64

This function computes a 64-bit hash value using the FarmHash algorithm.

### Syntax

```sql
farmHash64(par1, ...)
```

### Arguments

- `par1, ...`: A variable number of input parameters of any [supported data type](../data-types/string).

### Returns

A 64-bit hash value. [UInt64](../data-types/int-uint).

### Example

```sql
SELECT farmHash64(array('e','x','a'), 'mple', 10, toDateTime('2019-06-15 23:00:00')) AS FarmHash, toTypeName(FarmHash) AS type
```

Result:

```result
┌─────────────FarmHash─┬─type───┐
│ 17790458267262532859 │ UInt64 │
└──────────────────────┴────────┘
```

## javaHash

Calculates a hash value compatible with Java's `hashCode()` method for strings, bytes, shorts, integers, and longs. This function is primarily useful for compatibility with existing Java systems rather than for high-quality or fast hashing.

### Syntax

```sql
javaHash(value)
```

### Arguments

- `value`: The input value to hash. Can be a [String](../data-types/string) or an integer type.

### Returns

A 32-bit signed integer hash value. [Int32](../data-types/int-uint).

### Example

```sql
SELECT javaHash(toInt32(123))
```

Result:

```result
┌─javaHash(toInt32(123))─┐
│               123      │
└────────────────────────┘
```

```sql
SELECT javaHash('Hello, world!')
```

Result:

```result
┌─javaHash('Hello, world!')─┐
│               -1880044555 │
└───────────────────────────┘
```

## javaHashUTF16LE

Calculates a Java-compatible hash value for a string, assuming the input string is encoded in UTF-16LE.

### Syntax

```sql
javaHashUTF16LE(stringUtf16le)
```

### Arguments

- `stringUtf16le`: A string encoded in UTF-16LE. [String](../data-types/string).

### Returns

A 32-bit signed integer hash value. [Int32](../data-types/int-uint).

### Example

```sql
SELECT javaHashUTF16LE(convertCharset('test', 'utf-8', 'utf-16le'))
```

Result:

```result
┌─javaHashUTF16LE(convertCharset('test', 'utf-8', 'utf-16le'))─┐
│                                                      3556498 │
└──────────────────────────────────────────────────────────────┘
```

## hiveHash

Calculates a hash value compatible with Apache Hive versions prior to 3.0. This function is essentially `javaHash` with the sign bit zeroed out, and is primarily used for compatibility with existing Hive systems.

### Syntax

```sql
hiveHash(value)
```

### Arguments

- `value`: The input value to hash. [String](../data-types/string).

### Returns

A 32-bit signed integer hash value. [Int32](../data-types/int-uint).

### Example

```sql
SELECT hiveHash('Hello, world!')
```

Result:

```result
┌─hiveHash('Hello, world!')─┐
│                 267439093 │
└───────────────────────────┘
```

## metroHash64

Produces a 64-bit MetroHash value, a fast non-cryptographic hash function.

### Syntax

```sql
metroHash64(par1, ...)
```

### Arguments

- `par1, ...`: A variable number of input parameters of any [supported data type](../data-types/string).

### Returns

A 64-bit hash value. [UInt64](../data-types/int-uint).

### Example

```sql
SELECT metroHash64(array('e','x','a'), 'mple', 10, toDateTime('2019-06-15 23:00:00')) AS MetroHash, toTypeName(MetroHash) AS type
```

Result:

```result
┌────────────MetroHash─┬─type───┐
│ 14235658766382344533 │ UInt64 │
└──────────────────────┴────────┘
```

## jumpConsistentHash

Calculates a Jump Consistent Hash for a given key and number of buckets. This algorithm provides a simple and fast way to assign keys to buckets in a consistent manner.

### Syntax

```sql
jumpConsistentHash(key, num_buckets)
```

### Arguments

- `key`: A 64-bit unsigned integer key. [UInt64](../data-types/int-uint).
- `num_buckets`: The number of available buckets. [Int32](../data-types/int-uint).

### Returns

The assigned bucket index. [Int32](../data-types/int-uint).

### Example

```sql
SELECT jumpConsistentHash(1234567890123456789, 100) AS bucket_id
```

Result:

```result
┌─bucket_id─┐
│        42 │
└───────────┘
```

## kostikConsistentHash

This function implements an O(1) time and space consistent hashing algorithm. It efficiently distributes keys among a fixed number of buckets.
Alias: `yandexConsistentHash`

### Syntax

```sql
kostikConsistentHash(input, n)
```

### Arguments

- `input`: A 64-bit unsigned integer key. [UInt64](../data-types/int-uint).
- `n`: The number of buckets. [UInt16](../data-types/int-uint).

### Returns

A 16-bit unsigned integer hash value representing the assigned bucket. [UInt16](../data-types/int-uint).

### Example

```sql
SELECT kostikConsistentHash(16045690984833335023, 2)
```

Result:

```result
┌─kostikConsistentHash(16045690984833335023, 2)─┐
│                                             1 │
└───────────────────────────────────────────────┘
```

## murmurHash2_32, murmurHash2_64

These functions produce 32-bit or 64-bit MurmurHash2 values, which are fast, non-cryptographic hash functions suitable for general-purpose hashing.

### Syntax

```sql
murmurHash2_32(par1, ...)
murmurHash2_64(par1, ...)
```

### Arguments

- `par1, ...`: A variable number of input parameters of any [supported data type](../data-types/string).

### Returns

- `murmurHash2_32`: A 32-bit hash value. [UInt32](../data-types/int-uint).
- `murmurHash2_64`: A 64-bit hash value. [UInt64](../data-types/int-uint).

### Example

```sql
SELECT murmurHash2_64(array('e','x','a'), 'mple', 10, toDateTime('2019-06-15 23:00:00')) AS MurmurHash2, toTypeName(MurmurHash2) AS type
```

Result:

```result
┌──────────MurmurHash2─┬─type───┐
│ 11832096901709403633 │ UInt64 │
└──────────────────────┴────────┘
```

## gccMurmurHash

Calculates a 64-bit MurmurHash2 value using the same hash seed as GCC's standard library. This ensures portability of hash results between different compilers like Clang and GCC.

### Syntax

```sql
gccMurmurHash(par1, ...)
```

### Arguments

- `par1, ...`: A variable number of parameters of any [supported data type](../data-types/string).

### Returns

A 64-bit hash value. [UInt64](../data-types/int-uint).

### Example

```sql
SELECT
    gccMurmurHash(1, 2, 3) AS res1,
    gccMurmurHash(('a', [1, 2, 3], 4, (4, ['foo', 'bar'], 1, (1, 2)))) AS res2
```

Result:

```result
┌─────────────────res1─┬────────────────res2─┐
│ 12384823029245979431 │ 1188926775431157506 │
└──────────────────────┴─────────────────────┘
```

## kafkaMurmurHash

Calculates a 32-bit MurmurHash2 value, specifically designed to be compatible with Apache Kafka's default partitioner. It uses Kafka's hash seed and clears the highest bit of the result.

### Syntax

```sql
kafkaMurmurHash(par1, ...)
```

### Arguments

- `par1, ...`: A variable number of parameters of any [supported data type](../data-types/string).

### Returns

A 32-bit hash value. [UInt32](../data-types/int-uint).

### Example

```sql
SELECT
    kafkaMurmurHash('foobar') AS res1,
    kafkaMurmurHash(array('e','x','a'), 'mple', 10, toDateTime('2019-06-15 23:00:00')) AS res2
```

Result:

```result
┌───────res1─┬─────res2─┐
│ 1357151166 │ 85479775 │
└────────────┴──────────┘
```

## murmurHash3_32, murmurHash3_64

These functions produce 32-bit or 64-bit MurmurHash3 values, which are fast, non-cryptographic hash functions offering improved collision resistance over MurmurHash2.

### Syntax

```sql
murmurHash3_32(par1, ...)
murmurHash3_64(par1, ...)
```

### Arguments

- `par1, ...`: A variable number of input parameters of any [supported data type](../data-types/string).

### Returns

- `murmurHash3_32`: A 32-bit hash value. [UInt32](../data-types/int-uint).
- `murmurHash3_64`: A 64-bit hash value. [UInt64](../data-types/int-uint).

### Example

```sql
SELECT murmurHash3_32(array('e','x','a'), 'mple', 10, toDateTime('2019-06-15 23:00:00')) AS MurmurHash3, toTypeName(MurmurHash3) AS type
```

Result:

```result
┌─MurmurHash3─┬─type───┐
│     2152717 │ UInt32 │
└─────────────┴────────┘
```

## murmurHash3_128

Produces a 128-bit MurmurHash3 value, providing a longer hash for increased uniqueness and reduced collision probability.

### Syntax

```sql
murmurHash3_128(expr)
```

### Arguments

- `expr`: A list of expressions to hash. [String](../data-types/string).

### Returns

A 128-bit MurmurHash3 hash value. [FixedString(16)](../data-types/fixedstring).

### Example

```sql
SELECT hex(murmurHash3_128('foo', 'foo', 'foo'))
```

Result:

```result
┌─hex(murmurHash3_128('foo', 'foo', 'foo'))─┐
│ F8F7AD9B6CD4CF117A71E277E2EC2931          │
└───────────────────────────────────────────┘
```

## xxh3

Produces a 64-bit hash value using the xxh3 algorithm, known for its extreme speed and good hash quality.

### Syntax

```sql
xxh3(expr)
```

### Arguments

- `expr`: A list of expressions of any data type to hash.

### Returns

A 64-bit xxh3 hash value. [UInt64](../data-types/int-uint).

### Example

```sql
SELECT xxh3('Hello', 'world')
```

Result:

```result
┌─xxh3('Hello', 'world')─┐
│    5607458076371731292 │
└────────────────────────┘
```

## xxHash32, xxHash64

These functions calculate `xxHash` values from a string input, available in 32-bit and 64-bit versions. xxHash is a very fast non-cryptographic hash algorithm.

### Syntax

```sql
xxHash32(input_string)
xxHash64(input_string)
```

### Arguments

- `input_string`: The string to hash. [String](../data-types/string).

### Returns

- `xxHash32`: A 32-bit hash value. [UInt32](../data-types/int-uint).
- `xxHash64`: A 64-bit hash value. [UInt64](../data-types/int-uint).

{% callout type="info" %}
The return type will be `UInt32` for `xxHash32` and `UInt64` for `xxHash64`.
{% /callout %}

### Example

```sql
SELECT xxHash32('Hello, world!')
```

Result:

```result
┌─xxHash32('Hello, world!')─┐
│                 834093149 │
└───────────────────────────┘
```

## ngramSimHash

Splits an ASCII string into n-grams (sequences of `ngramsize` symbols) and computes a `simhash` for these n-grams. This function is case-sensitive.

This function is useful for identifying similar strings; a smaller [Hamming Distance](bit-functions#bithammingdistance) between two `simhashes` indicates greater similarity between the original strings.

### Syntax

```sql
ngramSimHash(string[, ngramsize])
```

### Arguments

- `string`: The ASCII string to process. [String](../data-types/string).
- `ngramsize`: The length of each n-gram. Optional. Valid values are `1` to `25`. Default is `3`. [UInt8](../data-types/int-uint).

### Returns

A 64-bit hash value. [UInt64](../data-types/int-uint).

### Example

```sql
SELECT ngramSimHash('Bazinga') AS Hash
```

Result:

```result
┌───────Hash─┐
│ 1627567969 │
└────────────┘
```

## ngramSimHashCaseInsensitive

Splits an ASCII string into n-grams (sequences of `ngramsize` symbols) and computes a `simhash` for these n-grams, ignoring case.

This function is useful for identifying similar strings; a smaller [Hamming Distance](bit-functions#bithammingdistance) between two `simhashes` indicates greater similarity between the original strings.

### Syntax

```sql
ngramSimHashCaseInsensitive(string[, ngramsize])
```

### Arguments

- `string`: The ASCII string to process. [String](../data-types/string).
- `ngramsize`: The length of each n-gram. Optional. Valid values are `1` to `25`. Default is `3`. [UInt8](../data-types/int-uint).

### Returns

A 64-bit hash value. [UInt64](../data-types/int-uint).

### Example

```sql
SELECT ngramSimHashCaseInsensitive('Bazinga') AS Hash
```

Result:

```result
┌──────Hash─┐
│ 562180645 │
└───────────┘
```

## ngramSimHashUTF8

Splits a UTF-8 string into n-grams (sequences of `ngramsize` symbols) and computes a `simhash` for these n-grams. This function is case-sensitive.

This function is useful for identifying similar strings; a smaller [Hamming Distance](bit-functions#bithammingdistance) between two `simhashes` indicates greater similarity between the original strings.

### Syntax

```sql
ngramSimHashUTF8(string[, ngramsize])
```

### Arguments

- `string`: The UTF-8 string to process. [String](../data-types/string).
- `ngramsize`: The length of each n-gram. Optional. Valid values are `1` to `25`. Default is `3`. [UInt8](../data-types/int-uint).

### Returns

A 64-bit hash value. [UInt64](../data-types/int-uint).

### Example

```sql
SELECT ngramSimHashUTF8('Bazinga') AS Hash
```

Result:

```result
┌───────Hash─┐
│ 1628157797 │
└────────────┘
```

## ngramSimHashCaseInsensitiveUTF8

Splits a UTF-8 string into n-grams (sequences of `ngramsize` symbols) and computes a `simhash` for these n-grams, ignoring case.

This function is useful for identifying similar strings; a smaller [Hamming Distance](bit-functions#bithammingdistance) between two `simhashes` indicates greater similarity between the original strings.

### Syntax

```sql
ngramSimHashCaseInsensitiveUTF8(string[, ngramsize])
```

### Arguments

- `string`: The UTF-8 string to process. [String](../data-types/string).
- `ngramsize`: The length of each n-gram. Optional. Valid values are `1` to `25`. Default is `3`. [UInt8](../data-types/int-uint).

### Returns

A 64-bit hash value. [UInt64](../data-types/int-uint).

### Example

```sql
SELECT ngramSimHashCaseInsensitiveUTF8('Bazinga') AS Hash
```

Result:

```result
┌───────Hash─┐
│ 1636742693 │
└────────────┘
```

## wordShingleSimHash

Splits an ASCII string into word shingles (sequences of `shinglesize` words) and computes a `simhash` for these shingles. This function is case-sensitive.

This function is useful for identifying similar strings; a smaller [Hamming Distance](bit-functions#bithammingdistance) between two `simhashes` indicates greater similarity between the original strings.

### Syntax

```sql
wordShingleSimHash(string[, shinglesize])
```

### Arguments

- `string`: The ASCII string to process. [String](../data-types/string).
- `shinglesize`: The number of words in each shingle. Optional. Valid values are `1` to `25`. Default is `3`. [UInt8](../data-types/int-uint).

### Returns

A 64-bit hash value. [UInt64](../data-types/int-uint).

### Example

```sql
SELECT wordShingleSimHash('Bazinga® is a column-oriented database management system (DBMS) for online analytical processing of queries (OLAP).') AS Hash
```

Result:

```result
┌───────Hash─┐
│ 2328277067 │
└────────────┘
```

## wordShingleSimHashCaseInsensitive

Splits an ASCII string into word shingles (sequences of `shinglesize` words) and computes a `simhash` for these shingles, ignoring case.

This function is useful for identifying similar strings; a smaller [Hamming Distance](bit-functions#bithammingdistance) between two `simhashes` indicates greater similarity between the original strings.

### Syntax

```sql
wordShingleSimHashCaseInsensitive(string[, shinglesize])
```

### Arguments

- `string`: The ASCII string to process. [String](../data-types/string).
- `shinglesize`: The number of words in each shingle. Optional. Valid values are `1` to `25`. Default is `3`. [UInt8](../data-types/int-uint).

### Returns

A 64-bit hash value. [UInt64](../data-types/int-uint).

### Example

```sql
SELECT wordShingleSimHashCaseInsensitive('Bazinga® is a column-oriented database management system (DBMS) for online analytical processing of queries (OLAP).') AS Hash
```

Result:

```result
┌───────Hash─┐
│ 2194812424 │
└────────────┘
```

## wordShingleSimHashUTF8

Splits a UTF-8 string into word shingles (sequences of `shinglesize` words) and computes a `simhash` for these shingles. This function is case-sensitive.

This function is useful for identifying similar strings; a smaller [Hamming Distance](bit-functions#bithammingdistance) between two `simhashes` indicates greater similarity between the original strings.

### Syntax

```sql
wordShingleSimHashUTF8(string[, shinglesize])
```

### Arguments

- `string`: The UTF-8 string to process. [String](../data-types/string).
- `shinglesize`: The number of words in each shingle. Optional. Valid values are `1` to `25`. Default is `3`. [UInt8](../data-types/int-uint).

### Returns

A 64-bit hash value. [UInt64](../data-types/int-uint).

### Example

```sql
SELECT wordShingleSimHashUTF8('Bazinga® is a column-oriented database management system (DBMS) for online analytical processing of queries (OLAP).') AS Hash
```

Result:

```result
┌───────Hash─┐
│ 2328277067 │
└────────────┘
```

## wordShingleSimHashCaseInsensitiveUTF8

Splits a UTF-8 string into word shingles (sequences of `shinglesize` words) and computes a `simhash` for these shingles, ignoring case.

This function is useful for identifying similar strings; a smaller [Hamming Distance](bit-functions#bithammingdistance) between two `simhashes` indicates greater similarity between the original strings.

### Syntax

```sql
wordShingleSimHashCaseInsensitiveUTF8(string[, shinglesize])
```

### Arguments

- `string`: The UTF-8 string to process. [String](../data-types/string).
- `shinglesize`: The number of words in each shingle. Optional. Valid values are `1` to `25`. Default is `3`. [UInt8](../data-types/int-uint).

### Returns

A 64-bit hash value. [UInt64](../data-types/int-uint).

### Example

```sql
SELECT wordShingleSimHashCaseInsensitiveUTF8('Bazinga® is a column-oriented database management system (DBMS) for online analytical processing of queries (OLAP).') AS Hash
```

Result:

```result
┌───────Hash─┐
│ 2194812424 │
└────────────┘
```

## wyHash64

Produces a 64-bit hash value using the wyHash64 algorithm, a fast and high-quality non-cryptographic hash function.

### Syntax

```sql
wyHash64(string)
```

### Arguments

- `string`: The string to hash. [String](../data-types/string).

### Returns

A 64-bit hash value. [UInt64](../data-types/int-uint).

### Example

```sql
SELECT wyHash64('Bazinga') AS Hash
```

Result:

```result
┌─────────────────Hash─┐
│ 12336419557878201794 │
└──────────────────────┘
```

## ngramMinHash

Splits an ASCII string into n-grams and calculates minimum and maximum hash values for these n-grams. It returns a tuple containing these two hashes and is case-sensitive.

This function is useful for detecting semi-duplicate strings. If one of the returned hashes is identical for two strings, it suggests a high degree of similarity.

### Syntax

```sql
ngramMinHash(string[, ngramsize, hashnum])
```

### Arguments

- `string`: The ASCII string to process. [String](../data-types/string).
- `ngramsize`: The length of each n-gram. Optional. Valid values are `1` to `25`. Default is `3`. [UInt8](../data-types/int-uint).
- `hashnum`: The number of minimum and maximum hashes to use. Optional. Valid values are `1` to `25`. Default is `6`. [UInt8](../data-types/int-uint).

### Returns

A [tuple](../data-types/tuple) containing two [UInt64](../data-types/int-uint) hash values (minimum and maximum). [Tuple](../data-types/tuple)([UInt64](../data-types/int-uint), [UInt64](../data-types/int-uint)).

### Example

```sql
SELECT ngramMinHash('Bazinga') AS Tuple
```

Result:

```result
┌─Tuple──────────────────────────────────────┐
│ (18333312859352735453,9054248444481805918) │
└────────────────────────────────────────────┘
```

## ngramMinHashCaseInsensitive

Splits an ASCII string into n-grams and calculates minimum and maximum hash values for these n-grams, ignoring case. It returns a tuple containing these two hashes.

This function is useful for detecting semi-duplicate strings. If one of the returned hashes is identical for two strings, it suggests a high degree of similarity.

### Syntax

```sql
ngramMinHashCaseInsensitive(string[, ngramsize, hashnum])
```

### Arguments

- `string`: The ASCII string to process. [String](../data-types/string).
- `ngramsize`: The length of each n-gram. Optional. Valid values are `1` to `25`. Default is `3`. [UInt8](../data-types/int-uint).
- `hashnum`: The number of minimum and maximum hashes to use. Optional. Valid values are `1` to `25`. Default is `6`. [UInt8](../data-types/int-uint).

### Returns

A [tuple](../data-types/tuple) containing two [UInt64](../data-types/int-uint) hash values (minimum and maximum). [Tuple](../data-types/tuple)([UInt64](../data-types/int-uint), [UInt64](../data-types/int-uint)).

### Example

```sql
SELECT ngramMinHashCaseInsensitive('Bazinga') AS Tuple
```

Result:

```result
┌─Tuple──────────────────────────────────────┐
│ (2106263556442004574,13203602793651726206) │
└────────────────────────────────────────────┘
```

## ngramMinHashUTF8

Splits a UTF-8 string into n-grams and calculates minimum and maximum hash values for these n-grams. It returns a tuple containing these two hashes and is case-sensitive.

This function is useful for detecting semi-duplicate strings. If one of the returned hashes is identical for two strings, it suggests a high degree of similarity.

### Syntax

```sql
ngramMinHashUTF8(string[, ngramsize, hashnum])
```

### Arguments

- `string`: The UTF-8 string to process. [String](../data-types/string).
- `ngramsize`: The length of each n-gram. Optional. Valid values are `1` to `25`. Default is `3`. [UInt8](../data-types/int-uint).
- `hashnum`: The number of minimum and maximum hashes to use. Optional. Valid values are `1` to `25`. Default is `6`. [UInt8](../data-types/int-uint).

### Returns

A [tuple](../data-types/tuple) containing two [UInt64](../data-types/int-uint) hash values (minimum and maximum). [Tuple](../data-types/tuple)([UInt64](../data-types/int-uint), [UInt64](../data-types/int-uint)).

### Example

```sql
SELECT ngramMinHashUTF8('Bazinga') AS Tuple
```

Result:

```result
┌─Tuple──────────────────────────────────────┐
│ (18333312859352735453,6742163577938632877) │
└────────────────────────────────────────────┘
```

## ngramMinHashCaseInsensitiveUTF8

Splits a UTF-8 string into n-grams and calculates minimum and maximum hash values for these n-grams, ignoring case. It returns a tuple containing these two hashes.

This function is useful for detecting semi-duplicate strings. If one of the returned hashes is identical for two strings, it suggests a high degree of similarity.

### Syntax

```sql
ngramMinHashCaseInsensitiveUTF8(string [, ngramsize, hashnum])
```

### Arguments

- `string`: The UTF-8 string to process. [String](../data-types/string).
- `ngramsize`: The length of each n-gram. Optional. Valid values are `1` to `25`. Default is `3`. [UInt8](../data-types/int-uint).
- `hashnum`: The number of minimum and maximum hashes to use. Optional. Valid values are `1` to `25`. Default is `6`. [UInt8](../data-types/int-uint).

### Returns

A [tuple](../data-types/tuple) containing two [UInt64](../data-types/int-uint) hash values (minimum and maximum). [Tuple](../data-types/tuple)([UInt64](../data-types/int-uint), [UInt64](../data-types/int-uint)).

### Example

```sql
SELECT ngramMinHashCaseInsensitiveUTF8('Bazinga') AS Tuple
```

Result:

```result
┌─Tuple───────────────────────────────────────┐
│ (12493625717655877135,13203602793651726206) │
└─────────────────────────────────────────────┘
```

## ngramMinHashArg

Splits an ASCII string into n-grams and returns the specific n-grams that correspond to the minimum and maximum hash values, as determined by `ngramMinHash`. This function is case-sensitive.

### Syntax

```sql
ngramMinHashArg(string[, ngramsize, hashnum])
```

### Arguments

- `string`: The ASCII string to process. [String](../data-types/string).
- `ngramsize`: The length of each n-gram. Optional. Valid values are `1` to `25`. Default is `3`. [UInt8](../data-types/int-uint).
- `hashnum`: The number of minimum and maximum hashes to use. Optional. Valid values are `1` to `25`. Default is `6`. [UInt8](../data-types/int-uint).

### Returns

A [tuple](../data-types/tuple) containing two [tuples](../data-types/tuple) of [strings](../data-types/string), representing the `hashnum` n-grams with the minimum and maximum hash values. [Tuple](../data-types/tuple)([Tuple](../data-types/tuple)([String](../data-types/string)), [Tuple](../data-types/tuple)([String](../data-types/string))).

### Example

```sql
SELECT ngramMinHashArg('Bazinga') AS Tuple
```

Result:

```result
┌─Tuple─────────────────────────────────────────────────────────────────────────┐
│ (('ous','ick','lic','Hou','kHo','use'),('Hou','lic','ick','ous','ckH','Cli')) │
└───────────────────────────────────────────────────────────────────────────────┘
```

## ngramMinHashArgCaseInsensitive

Splits an ASCII string into n-grams and returns the specific n-grams that correspond to the minimum and maximum hash values, as determined by `ngramMinHashCaseInsensitive`, ignoring case.

### Syntax

```sql
ngramMinHashArgCaseInsensitive(string[, ngramsize, hashnum])
```

### Arguments

- `string`: The ASCII string to process. [String](../data-types/string).
- `ngramsize`: The length of each n-gram. Optional. Valid values are `1` to `25`. Default is `3`. [UInt8](../data-types/int-uint).
- `hashnum`: The number of minimum and maximum hashes to use. Optional. Valid values are `1` to `25`. Default is `6`. [UInt8](../data-types/int-uint).

### Returns

A [tuple](../data-types/tuple) containing two [tuples](../data-types/tuple) of [strings](../data-types/string), representing the `hashnum` n-grams with the minimum and maximum hash values. [Tuple](../data-types/tuple)([Tuple](../data-types/tuple)([String](../data-types/string)), [Tuple](../data-types/tuple)([String](../data-types/string))).

### Example

```sql
SELECT ngramMinHashArgCaseInsensitive('Bazinga') AS Tuple
```

Result:

```result
┌─Tuple─────────────────────────────────────────────────────────────────────────┐
│ (('ous','ick','lic','kHo','use','Cli'),('kHo','lic','ick','ous','ckH','Hou')) │
└───────────────────────────────────────────────────────────────────────────────┘
```

## ngramMinHashArgUTF8

Splits a UTF-8 string into n-grams and returns the specific n-grams that correspond to the minimum and maximum hash values, as determined by `ngramMinHashUTF8`. This function is case-sensitive.

### Syntax

```sql
ngramMinHashArgUTF8(string[, ngramsize, hashnum])
```

### Arguments

- `string`: The UTF-8 string to process. [String](../data-types/string).
- `ngramsize`: The length of each n-gram. Optional. Valid values are `1` to `25`. Default is `3`. [UInt8](../data-types/int-uint).
- `hashnum`: The number of minimum and maximum hashes to use. Optional. Valid values are `1` to `25`. Default is `6`. [UInt8](../data-types/int-uint).

### Returns

A [tuple](../data-types/tuple) containing two [tuples](../data-types/tuple) of [strings](../data-types/string), representing the `hashnum` n-grams with the minimum and maximum hash values. [Tuple](../data-types/tuple)([Tuple](../data-types/tuple)([String](../data-types/string)), [Tuple](../data-types/tuple)([String](../data-types/string))).

### Example

```sql
SELECT ngramMinHashArgUTF8('Bazinga') AS Tuple
```

Result:

```result
┌─Tuple─────────────────────────────────────────────────────────────────────────┐
│ (('ous','ick','lic','Hou','kHo','use'),('kHo','Hou','lic','ick','ous','ckH')) │
└───────────────────────────────────────────────────────────────────────────────┘
```

## ngramMinHashArgCaseInsensitiveUTF8

Splits a UTF-8 string into n-grams and returns the specific n-grams that correspond to the minimum and maximum hash values, as determined by `ngramMinHashCaseInsensitiveUTF8`, ignoring case.

### Syntax

```sql
ngramMinHashArgCaseInsensitiveUTF8(string[, ngramsize, hashnum])
```

### Arguments

- `string`: The UTF-8 string to process. [String](../data-types/string).
- `ngramsize`: The length of each n-gram. Optional. Valid values are `1` to `25`. Default is `3`. [UInt8](../data-types/int-uint).
- `hashnum`: The number of minimum and maximum hashes to use. Optional. Valid values are `1` to `25`. Default is `6`. [UInt8](../data-types/int-uint).

### Returns

A [tuple](../data-types/tuple) containing two [tuples](../data-types/tuple) of [strings](../data-types/string), representing the `hashnum` n-grams with the minimum and maximum hash values. [Tuple](../data-types/tuple)([Tuple](../data-types/tuple)([String](../data-types/string)), [Tuple](../data-types/tuple)([String](../data-types/string))).

### Example

```sql
SELECT ngramMinHashArgCaseInsensitiveUTF8('Bazinga') AS Tuple
```

Result:

```result
┌─Tuple─────────────────────────────────────────────────────────────────────────┐
│ (('ckH','ous','ick','lic','kHo','use'),('kHo','lic','ick','ous','ckH','Hou')) │
└───────────────────────────────────────────────────────────────────────────────┘
```

## wordShingleMinHash

Splits an ASCII string into word shingles and calculates minimum and maximum hash values for these shingles. It returns a tuple containing these two hashes and is case-sensitive.

This function is useful for detecting semi-duplicate strings. If one of the returned hashes is identical for two strings, it suggests a high degree of similarity.

### Syntax

```sql
wordShingleMinHash(string[, shinglesize, hashnum])
```

### Arguments

- `string`: The ASCII string to process. [String](../data-types/string).
- `shinglesize`: The number of words in each shingle. Optional. Valid values are `1` to `25`. Default is `3`. [UInt8](../data-types/int-uint).
- `hashnum`: The number of minimum and maximum hashes to use. Optional. Valid values are `1` to `25`. Default is `6`. [UInt8](../data-types/int-uint).

### Returns

A [tuple](../data-types/tuple) containing two [UInt64](../data-types/int-uint) hash values (minimum and maximum). [Tuple](../data-types/tuple)([UInt64](../data-types/int-uint), [UInt64](../data-types/int-uint)).

### Example

```sql
SELECT wordShingleMinHash('Bazinga® is a column-oriented database management system (DBMS) for online analytical processing of queries (OLAP).') AS Tuple
```

Result:

```result
┌─Tuple──────────────────────────────────────┐
│ (16452112859864147620,5844417301642981317) │
└────────────────────────────────────────────┘
```

## wordShingleMinHashCaseInsensitive

Splits an ASCII string into word shingles and calculates minimum and maximum hash values for these shingles, ignoring case. It returns a tuple containing these two hashes.

This function is useful for detecting semi-duplicate strings. If one of the returned hashes is identical for two strings, it suggests a high degree of similarity.

### Syntax

```sql
wordShingleMinHashCaseInsensitive(string[, shinglesize, hashnum])
```

### Arguments

- `string`: The ASCII string to process. [String](../data-types/string).
- `shinglesize`: The number of words in each shingle. Optional. Valid values are `1` to `25`. Default is `3`. [UInt8](../data-types/int-uint).
- `hashnum`: The number of minimum and maximum hashes to use. Optional. Valid values are `1` to `25`. Default is `6`. [UInt8](../data-types/int-uint).

### Returns

A [tuple](../data-types/tuple) containing two [UInt64](../data-types/int-uint) hash values (minimum and maximum). [Tuple](../data-types/tuple)([UInt64](../data-types/int-uint), [UInt64](../data-types/int-uint)).

### Example

```sql
SELECT wordShingleMinHashCaseInsensitive('Bazinga® is a column-oriented database management system (DBMS) for online analytical processing of queries (OLAP).') AS Tuple
```

Result:

```result
┌─Tuple─────────────────────────────────────┐
│ (3065874883688416519,1634050779997673240) │
└───────────────────────────────────────────┘
```

## wordShingleMinHashUTF8

Splits a UTF-8 string into word shingles and calculates minimum and maximum hash values for these shingles. It returns a tuple containing these two hashes and is case-sensitive.

This function is useful for detecting semi-duplicate strings. If one of the returned hashes is identical for two strings, it suggests a high degree of similarity.

### Syntax

```sql
wordShingleMinHashUTF8(string[, shinglesize, hashnum])
```

### Arguments

- `string`: The UTF-8 string to process. [String](../data-types/string).
- `shinglesize`: The number of words in each shingle. Optional. Valid values are `1` to `25`. Default is `3`. [UInt8](../data-types/int-uint).
- `hashnum`: The number of minimum and maximum hashes to use. Optional. Valid values are `1` to `25`. Default is `6`. [UInt8](../data-types/int-uint).

### Returns

A [tuple](../data-types/tuple) containing two [UInt64](../data-types/int-uint) hash values (minimum and maximum). [Tuple](../data-types/tuple)([UInt64](../data-types/int-uint), [UInt64](../data-types/int-uint)).

### Example

```sql
SELECT wordShingleMinHashUTF8('Bazinga® is a column-oriented database management system (DBMS) for online analytical processing of queries (OLAP).') AS Tuple
```

Result:

```result
┌─Tuple──────────────────────────────────────┐
│ (16452112859864147620,5844417301642981317) │
└────────────────────────────────────────────┘
```

## wordShingleMinHashCaseInsensitiveUTF8

Splits a UTF-8 string into word shingles and calculates minimum and maximum hash values for these shingles, ignoring case. It returns a tuple containing these two hashes.

This function is useful for detecting semi-duplicate strings. If one of the returned hashes is identical for two strings, it suggests a high degree of similarity.

### Syntax

```sql
wordShingleMinHashCaseInsensitiveUTF8(string[, shinglesize, hashnum])
```

### Arguments

- `string`: The UTF-8 string to process. [String](../data-types/string).
- `shinglesize`: The number of words in each shingle. Optional. Valid values are `1` to `25`. Default is `3`. [UInt8](../data-types/int-uint).
- `hashnum`: The number of minimum and maximum hashes to use. Optional. Valid values are `1` to `25`. Default is `6`. [UInt8](../data-types/int-uint).

### Returns

A [tuple](../data-types/tuple) containing two [UInt64](../data-types/int-uint) hash values (minimum and maximum). [Tuple](../data-types/tuple)([UInt64](../data-types/int-uint), [UInt64](../data-types/int-uint)).

### Example

```sql
SELECT wordShingleMinHashCaseInsensitiveUTF8('Bazinga® is a column-oriented database management system (DBMS) for online analytical processing of queries (OLAP).') AS Tuple
```

Result:

```result
┌─Tuple─────────────────────────────────────┐
│ (3065874883688416519,1634050779997673240) │
└───────────────────────────────────────────┘
```

## wordShingleMinHashArg

Splits an ASCII string into word shingles and returns the specific word shingles that correspond to the minimum and maximum hash values, as determined by `wordShingleMinHash`. This function is case-sensitive.

### Syntax

```sql
wordShingleMinHashArg(string[, shinglesize, hashnum])
```

### Arguments

- `string`: The ASCII string to process. [String](../data-types/string).
- `shinglesize`: The number of words in each shingle. Optional. Valid values are `1` to `25`. Default is `3`. [UInt8](../data-types/int-uint).
- `hashnum`: The number of minimum and maximum hashes to use. Optional. Valid values are `1` to `25`. Default is `6`. [UInt8](../data-types/int-uint).

### Returns

A [tuple](../data-types/tuple) containing two [tuples](../data-types/tuple) of [strings](../data-types/string), representing the `hashnum` word shingles with the minimum and maximum hash values. [Tuple](../data-types/tuple)([Tuple](../data-types/tuple)([String](../data-types/string)), [Tuple](../data-types/tuple)([String](../data-types/string))).

### Example

```sql
SELECT wordShingleMinHashArg('Bazinga® is a column-oriented database management system (DBMS) for online analytical processing of queries (OLAP).', 1, 3) AS Tuple
```

Result:

```result
┌─Tuple─────────────────────────────────────────────────────────────────┐
│ (('OLAP','database','analytical'),('online','oriented','processing')) │
└───────────────────────────────────────────────────────────────────────┘
```

## wordShingleMinHashArgCaseInsensitive

Splits an ASCII string into word shingles and returns the specific word shingles that correspond to the minimum and maximum hash values, as determined by `wordShingleMinHashCaseInsensitive`, ignoring case.

### Syntax

```sql
wordShingleMinHashArgCaseInsensitive(string[, shinglesize, hashnum])
```

### Arguments

- `string`: The ASCII string to process. [String](../data-types/string).
- `shinglesize`: The number of words in each shingle. Optional. Valid values are `1` to `25`. Default is `3`. [UInt8](../data-types/int-uint).
- `hashnum`: The number of minimum and maximum hashes to use. Optional. Valid values are `1` to `25`. Default is `6`. [UInt8](../data-types/int-uint).

### Returns

A [tuple](../data-types/tuple) containing two [tuples](../data-types/tuple) of [strings](../data-types/string), representing the `hashnum` word shingles with the minimum and maximum hash values. [Tuple](../data-types/tuple)([Tuple](../data-types/tuple)([String](../data-types/string)), [Tuple](../data-types/tuple)([String](../data-types/string))).

### Example

```sql
SELECT wordShingleMinHashArgCaseInsensitive('Bazinga® is a column-oriented database management system (DBMS) for online analytical processing of queries (OLAP).', 1, 3) AS Tuple
```

Result:

```result
┌─Tuple──────────────────────────────────────────────────────────────────┐
│ (('queries','database','analytical'),('oriented','processing','DBMS')) │
└────────────────────────────────────────────────────────────────────────┘
```

## wordShingleMinHashArgUTF8

Splits a UTF-8 string into word shingles and returns the specific word shingles that correspond to the minimum and maximum hash values, as determined by `wordShingleMinHashUTF8`. This function is case-sensitive.

### Syntax

```sql
wordShingleMinHashArgUTF8(string[, shinglesize, hashnum])
```

### Arguments

- `string`: The UTF-8 string to process. [String](../data-types/string).
- `shinglesize`: The number of words in each shingle. Optional. Valid values are `1` to `25`. Default is `3`. [UInt8](../data-types/int-uint).
- `hashnum`: The number of minimum and maximum hashes to use. Optional. Valid values are `1` to `25`. Default is `6`. [UInt8](../data-types/int-uint).

### Returns

A [tuple](../data-types/tuple) containing two [tuples](../data-types/tuple) of [strings](../data-types/string), representing the `hashnum` word shingles with the minimum and maximum hash values. [Tuple](../data-types/tuple)([Tuple](../data-types/tuple)([String](../data-types/string)), [Tuple](../data-types/tuple)([String](../data-types/string))).

### Example

```sql
SELECT wordShingleMinHashArgUTF8('Bazinga® is a column-oriented database management system (DBMS) for online analytical processing of queries (OLAP).', 1, 3) AS Tuple
```

Result:

```result
┌─Tuple─────────────────────────────────────────────────────────────────┐
│ (('OLAP','database','analytical'),('online','oriented','processing')) │
└───────────────────────────────────────────────────────────────────────┘
```

## wordShingleMinHashArgCaseInsensitiveUTF8

Splits a UTF-8 string into word shingles and returns the specific word shingles that correspond to the minimum and maximum hash values, as determined by `wordShingleMinHashCaseInsensitiveUTF8`, ignoring case.

### Syntax

```sql
wordShingleMinHashArgCaseInsensitiveUTF8(string[, shinglesize, hashnum])
```

### Arguments

- `string`: The UTF-8 string to process. [String](../data-types/string).
- `shinglesize`: The number of words in each shingle. Optional. Valid values are `1` to `25`. Default is `3`. [UInt8](../data-types/int-uint).
- `hashnum`: The number of minimum and maximum hashes to use. Optional. Valid values are `1` to `25`. Default is `6`. [UInt8](../data-types/int-uint).

### Returns

A [tuple](../data-types/tuple) containing two [tuples](../data-types/tuple) of [strings](../data-types/string), representing the `hashnum` word shingles with the minimum and maximum hash values. [Tuple](../data-types/tuple)([Tuple](../data-types/tuple)([String](../data-types/string)), [Tuple](../data-types/tuple)([String](../data-types/string))).

### Example

```sql
SELECT wordShingleMinHashArgCaseInsensitiveUTF8('Bazinga® is a column-oriented database management system (DBMS) for online analytical processing of queries (OLAP).', 1, 3) AS Tuple
```

Result:

```result
┌─Tuple──────────────────────────────────────────────────────────────────┐
│ (('queries','database','analytical'),('oriented','processing','DBMS')) │
└────────────────────────────────────────────────────────────────────────┘
```

## sqidEncode

Encodes a series of numbers into a short, YouTube-like ID string using the Sqid algorithm. The generated IDs are reversible, meaning they can be decoded back to the original numbers.
Alias: `sqid`

### Syntax

```sql
sqidEncode(number1, ...)
```

### Arguments

- `number1, ...`: A variable number of unsigned integer values ([UInt8](../data-types/int-uint), [UInt16](../data-types/int-uint), [UInt32](../data-types/int-uint), or [UInt64](../data-types/int-uint)).

### Returns

A Sqid [String](../data-types/string).

### Example

```sql
SELECT sqidEncode(1, 2, 3, 4, 5)
```

Result:

```result
┌─sqidEncode(1, 2, 3, 4, 5)─┐
│ gXHfJ1C6dN                │
└───────────────────────────┘
```

## sqidDecode

Decodes a Sqid string back into its original sequence of numbers. If the input string is not a valid Sqid, it returns an empty array.

### Syntax

```sql
sqidDecode(sqid)
```

### Arguments

- `sqid`: The Sqid string to decode. [String](../data-types/string).

### Returns

An [array](../data-types/array) of [UInt64](../data-types/int-uint) values representing the decoded numbers. [Array(UInt64)](../data-types/array).

### Example

```sql
SELECT sqidDecode('gXHfJ1C6dN')
```

Result:

```result
┌─sqidDecode('gXHfJ1C6dN')─┐
│ [1,2,3,4,5]              │
└──────────────────────────┘
```

## keccak256

Calculates the Keccak-256 hash of a string input. This cryptographic hash function is widely used in EVM-based blockchain technologies.

### Syntax

```sql
keccak256('s')
```

### Arguments

- `s`: The input string for Keccak-256 hash calculation. [String](../data-types/string).

### Returns

The Keccak-256 hash as a byte array. [FixedString(32)](../data-types/fixedstring).

### Example

Use the [hex](encoding-functions#hex) function to format the result as a hex-encoded string.

```sql
SELECT hex(keccak256('hello'))
```

Result:

```result
┌─hex(keccak256('hello'))──────────────────────────────────────────┐
│ 1C8AFF950685C2ED4BC3174F3472287B56D9517B9C948127319A09A7A36DEAC8 │
└──────────────────────────────────────────────────────────────────┘
```
