Hash functions

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

## wordShingleMinHashArgCaseInsensitive[​](#wordShingleMinHashArgCaseInsensitive "Direct link to wordShingleMinHashArgCaseInsensitive")

Introduced in: v21.1.0

Splits a ASCII string into parts (shingles) of `shinglesize` words each and returns the shingles with minimum and maximum word hashes, calculated by the [`wordShingleMinHashCaseInsensitive`](#wordShingleMinHashCaseInsensitive) function with the same input.
It is case insensitive.

**Syntax**

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

**Arguments**

- `string` — String for which to compute the hash. [`String`](/docs/sql-reference/data-types/string)
- `shinglesize` — Optional. The size of a word shingle, any number from `1` to `25`. The default value is `3`. [`UInt8`](/docs/sql-reference/data-types/int-uint)
- `hashnum` — Optional. The number of minimum and maximum hashes used to calculate the result, any number from `1` to `25`. The default value is `6`. [`UInt8`](/docs/sql-reference/data-types/int-uint)

**Returned value**

Returns a tuple with two tuples with `hashnum` word shingles each. [`Tuple(Tuple(String))`](/docs/sql-reference/data-types/tuple)

**Examples**

**Usage example**

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

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

## wordShingleMinHashArgCaseInsensitiveUTF8[​](#wordShingleMinHashArgCaseInsensitiveUTF8 "Direct link to wordShingleMinHashArgCaseInsensitiveUTF8")

Introduced in: v21.1.0

Splits a UTF-8 string into parts (shingles) of `shinglesize` words each and returns the shingles with minimum and maximum word hashes, calculated by the [`wordShingleMinHashCaseInsensitiveUTF8`](#wordShingleMinHashCaseInsensitiveUTF8) function with the same input.
It is case insensitive.

**Syntax**

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

**Arguments**

- `string` — String for which to compute the hash. [`String`](/docs/sql-reference/data-types/string)
- `shinglesize` — Optional. The size of a word shingle, any number from `1` to `25`. The default value is `3`. [`UInt8`](/docs/sql-reference/data-types/int-uint)
- `hashnum` — Optional. The number of minimum and maximum hashes used to calculate the result, any number from `1` to `25`. The default value is `6`. [`UInt8`](/docs/sql-reference/data-types/int-uint)

**Returned value**

Returns a tuple with two tuples with `hashnum` word shingles each. [`Tuple(Tuple(String))`](/docs/sql-reference/data-types/tuple)

**Examples**

**Usage example**

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

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

## wordShingleMinHashArgUTF8[​](#wordShingleMinHashArgUTF8 "Direct link to wordShingleMinHashArgUTF8")

Introduced in: v21.1.0

Splits a UTF-8 string into parts (shingles) of `shinglesize` words each and returns the shingles with minimum and maximum word hashes, calculated by the [`wordShingleMinHashUTF8`](#wordShingleMinHashUTF8) function with the same input.
It is case sensitive.

**Syntax**

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

**Arguments**

- `string` — String for which to compute the hash. [`String`](/docs/sql-reference/data-types/string)
- `shinglesize` — Optional. The size of a word shingle, any number from `1` to `25`. The default value is `3`. [`UInt8`](/docs/sql-reference/data-types/int-uint)
- `hashnum` — Optional. The number of minimum and maximum hashes used to calculate the result, any number from `1` to `25`. The default value is `6`. [`UInt8`](/docs/sql-reference/data-types/int-uint)

**Returned value**

Returns a tuple with two tuples with `hashnum` word shingles each. [`Tuple(Tuple(String))`](/docs/sql-reference/data-types/tuple)

**Examples**

**Usage example**

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

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

## wordShingleMinHashCaseInsensitive[​](#wordShingleMinHashCaseInsensitive "Direct link to wordShingleMinHashCaseInsensitive")

Introduced in: v21.1.0

Splits a ASCII string into parts (shingles) of `shinglesize` words, calculates hash values for each word shingle and returns a tuple with these hashes.
Uses `hashnum` minimum hashes to calculate the minimum hash and `hashnum` maximum hashes to calculate the maximum hash.
It is case insensitive.

Can be used to detect semi-duplicate strings with [`tupleHammingDistance`](/docs/sql-reference/functions/tuple-functions#tupleHammingDistance).
For two strings, if the returned hashes are the same for both strings, then those strings are the same.

**Syntax**

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

**Arguments**

- `string` — String for which to compute the hash. [`String`](/docs/sql-reference/data-types/string)
- `shinglesize` — Optional. The size of a word shingle, any number from `1` to `25`. The default value is `3`. [`UInt8`](/docs/sql-reference/data-types/int-uint)
- `hashnum` — Optional. The number of minimum and maximum hashes used to calculate the result, any number from `1` to `25`. The default value is `6`. [`UInt8`](/docs/sql-reference/data-types/int-uint)

**Returned value**

Returns a tuple with two hashes — the minimum and the maximum. [`Tuple(UInt64, UInt64)`](/docs/sql-reference/data-types/tuple)

**Examples**

**Usage example**

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

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

## wordShingleMinHashCaseInsensitiveUTF8[​](#wordShingleMinHashCaseInsensitiveUTF8 "Direct link to wordShingleMinHashCaseInsensitiveUTF8")

Introduced in: v21.1.0

Splits a UTF-8 string into parts (shingles) of `shinglesize` words, calculates hash values for each word shingle and returns a tuple with these hashes.
Uses `hashnum` minimum hashes to calculate the minimum hash and `hashnum` maximum hashes to calculate the maximum hash.
It is case insensitive.

Can be used to detect semi-duplicate strings with [`tupleHammingDistance`](/docs/sql-reference/functions/tuple-functions#tupleHammingDistance).
For two strings, if the returned hashes are the same for both strings, then those strings are the same.

**Syntax**

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

**Arguments**

- `string` — String for which to compute the hash. [`String`](/docs/sql-reference/data-types/string)
- `shinglesize` — Optional. The size of a word shingle, any number from `1` to `25`. The default value is `3`. [`UInt8`](/docs/sql-reference/data-types/int-uint)
- `hashnum` — Optional. The number of minimum and maximum hashes used to calculate the result, any number from `1` to `25`. The default value is `6`. [`UInt8`](/docs/sql-reference/data-types/int-uint)

**Returned value**