# Hash functions

> 28 Hash functions in NYXDB: names, aliases, signatures and behaviour.

{/* AUTO-GENERATED from the function catalog. DO NOT EDIT — overwritten on every build. */}

28 functions. Names resolve case-insensitively; an alias binds the same function as its canonical name. Each entry gives the signatures, the behaviour and an example.

| Function | Summary |
| --- | --- |
| [`hash_blake3`](#hash_blake3) | Produces the standard thirty-two-byte BLAKE3 digest for message contents. |
| [`hash_city_64`](#hash_city_64) | Combines typed values into a repeatable 64-bit CityHash fingerprint. |
| [`hash_crc32`](#hash_crc32) | Computes a 32-bit cyclic redundancy checksum for binary or UTF-8 input. |
| [`hash_farm_64`](#hash_farm_64) | Maps a sequence of typed arguments to the pinned FarmHash64 result. |
| [`hash_farm_fingerprint64`](#hash_farm_fingerprint64) | Produces a portable FarmHash fingerprint from canonically encoded arguments. |
| [`hash_hive`](#hash_hive) | Calculates the Hive-compatible signed checksum of a string’s encoded contents. |
| [`hash_hmac`](#hash_hmac) | Authenticates a message with a supplied key and a selected SHA-2 HMAC algorithm. |
| [`hash_int_32`](#hash_int_32) | Scrambles one integer into a compact unsigned 32-bit hash value. |
| [`hash_int_64`](#hash_int_64) | Derives an unsigned 64-bit mixing value directly from an integer. |
| [`hash_java`](#hash_java) | Reproduces Java string hash codes using UTF-16 code units and wrapped signed arithmetic. |
| [`hash_keccak256`](#hash_keccak256) | Returns the Keccak-256 digest, using the pre-standardization padding convention. |
| [`hash_md5`](#hash_md5) | Returns the sixteen raw MD5 digest bytes for a string or binary message. |
| [`hash_murmur_2_32`](#hash_murmur_2_32) | Calculates MurmurHash2’s 32-bit variant over a structured value sequence. |
| [`hash_murmur_2_64`](#hash_murmur_2_64) | Returns the wide MurmurHash2 fingerprint for canonical typed inputs. |
| [`hash_murmur_3_128`](#hash_murmur_3_128) | Generates sixteen raw fingerprint bytes using MurmurHash3 over typed values. |
| [`hash_murmur_3_32`](#hash_murmur_3_32) | Compresses canonically serialized arguments with the 32-bit MurmurHash3 algorithm. |
| [`hash_murmur_3_64`](#hash_murmur_3_64) | Computes a 64-bit MurmurHash3 result from the ordered argument encoding. |
| [`hash_sha1`](#hash_sha1) | Builds a twenty-byte SHA-1 compatibility digest from message bytes. |
| [`hash_sha224`](#hash_sha224) | Derives the SHA-224 digest as twenty-eight binary bytes. |
| [`hash_sha256`](#hash_sha256) | Returns a 256-bit SHA-2 digest of binary data or UTF-8 text. |
| [`hash_sha384`](#hash_sha384) | Calculates SHA-384 and exposes its forty-eight-byte binary digest. |
| [`hash_sha512`](#hash_sha512) | Hashes a message with SHA-512 to obtain sixty-four raw bytes. |
| [`hash_sha512_256`](#hash_sha512_256) | Computes the distinct SHA-512/256 construction for a thirty-two-byte result. |
| [`hash_sip_128`](#hash_sip_128) | Emits a sixteen-byte SipHash result for a sequence of structured arguments. |
| [`hash_sip_64`](#hash_sip_64) | Evaluates fixed-seed SipHash over one or more canonical SQL values. |
| [`hash_xx_32`](#hash_xx_32) | Creates a compact xxHash32 fingerprint from typed arguments. |
| [`hash_xx_64`](#hash_xx_64) | Computes the classic xxHash64 checksum over canonical value encodings. |
| [`hash_xxh3`](#hash_xxh3) | Fingerprints typed SQL values with the newer 64-bit XXH3 algorithm. |

## hash_blake3

Produces the standard thirty-two-byte BLAKE3 digest for message contents.

```text
hash_blake3(bytes|string) -> fixed_string(32)
```

| | |
| --- | --- |
| Kind | scalar |
| Signature class | `scalar/unary` |
| Returns | `fixed_string(32)` |
| Aliases | `blake3` |
| Streaming | Continuous — evaluated per row with no retained state. |
| Determinism | Deterministic — the same arguments always give the same result. |
| NULL handling | Any NULL argument gives NULL. |

Uses the ordinary unkeyed BLAKE3 hashing mode and returns fixed_string(32). Bytes are consumed directly and string input is UTF-8; neither extended output nor keyed mode is implied by this overload. NULL yields NULL and incompatible message types raise TYPE_MISMATCH; the algorithm remains a deferred implementation contract.

**Example**

```sql
length(hash_blake3('abc'))
-- → 32
```

## hash_city_64

Combines typed values into a repeatable 64-bit CityHash fingerprint.

```text
hash_city_64(T,...) -> uint64
```

| | |
| --- | --- |
| Kind | scalar |
| Signature class | `scalar/variadic+generic` |
| Returns | `uint64` |
| Aliases | `city_hash64`, `cityHash64` |
| Streaming | Continuous — evaluated per row with no retained state. |
| Determinism | Deterministic — the same arguments always give the same result. |
| NULL handling | Any NULL argument gives NULL. |

Hashes the canonical typed encoding of all arguments with a pinned CityHash64 version. Type boundaries participate, so concatenating display strings is not an equivalent input. Any NULL argument yields NULL; incompatible canonical encodings raise TYPE_MISMATCH, and this fast fingerprint is not a cryptographic authenticator.

**Example**

```sql
hash_city_64('sensor', 7) = hash_city_64('sensor', 7)
-- → true
```

## hash_crc32

Computes a 32-bit cyclic redundancy checksum for binary or UTF-8 input.

```text
hash_crc32(bytes|string) -> uint32
```

| | |
| --- | --- |
| Kind | scalar |
| Signature class | `scalar/unary` |
| Returns | `uint32` |
| Aliases | `crc32` |
| Streaming | Continuous — evaluated per row with no retained state. |
| Determinism | Deterministic — the same arguments always give the same result. |
| NULL handling | Any NULL argument gives NULL. |

Applies the CRC-32 checksum to the supplied bytes, interpreting a string as UTF-8. NULL produces NULL and empty input produces zero. The checksum detects common transmission damage rather than providing cryptographic collision resistance; incompatible argument types raise TYPE_MISMATCH.

**Example**

```sql
hash_crc32('123456789')
-- → 3421780262
```

## hash_farm_64

Maps a sequence of typed arguments to the pinned FarmHash64 result.

```text
hash_farm_64(T,...) -> uint64
```

| | |
| --- | --- |
| Kind | scalar |
| Signature class | `scalar/variadic+generic` |
| Returns | `uint64` |
| Aliases | `farm_hash64` |
| Streaming | Continuous — evaluated per row with no retained state. |
| Determinism | Deterministic — the same arguments always give the same result. |
| NULL handling | Any NULL argument gives NULL. |

Feeds canonical value encodings into the selected FarmHash64 implementation variant. The variant is part of the compatibility contract rather than being selected opportunistically by hardware. NULL in the argument list propagates; TYPE_MISMATCH rejects values without an admitted encoding, and collisions remain possible.

**Example**

```sql
hash_farm_64('reading', 12) = hash_farm_64('reading', 12)
-- → true
```

## hash_farm_fingerprint64

Produces a portable FarmHash fingerprint from canonically encoded arguments.

```text
hash_farm_fingerprint64(T,...) -> uint64
```

| | |
| --- | --- |
| Kind | scalar |
| Signature class | `scalar/variadic+generic` |
| Returns | `uint64` |
| Aliases | `farm_fingerprint64` |
| Streaming | Continuous — evaluated per row with no retained state. |
| Determinism | Deterministic — the same arguments always give the same result. |
| NULL handling | Any NULL argument gives NULL. |

Uses the stable Fingerprint64 operation over typed arguments and their boundaries. Its output is an unsigned integer intended for repeatable partitioning or comparisons, not for proving authenticity. A NULL argument produces NULL, and incompatible value encodings raise TYPE_MISMATCH.

**Example**

```sql
hash_farm_fingerprint64('product', 3) = hash_farm_fingerprint64('product', 3)
-- → true
```

## hash_hive

Calculates the Hive-compatible signed checksum of a string’s encoded contents.

```text
hash_hive(string) -> int32
```

| | |
| --- | --- |
| Kind | scalar |
| Signature class | `scalar/unary` |
| Returns | `int32` |
| Aliases | `hive_hash` |
| Streaming | Continuous — evaluated per row with no retained state. |
| Determinism | Deterministic — the same arguments always give the same result. |
| NULL handling | Any NULL argument gives NULL. |

Returns an int32 using the Hive string-hashing contract, including its byte signedness and wrapping rules. Interoperability is fixed by versioned byte-level vectors, so callers should not substitute the Java Unicode routine for arbitrary text. NULL returns NULL and nonstring input raises TYPE_MISMATCH.

**Example**

```sql
hash_hive('')
-- → 0
```

## hash_hmac

Authenticates a message with a supplied key and a selected SHA-2 HMAC algorithm.

```text
hash_hmac(string,bytes,bytes) -> bytes
hash_hmac(string,string,string) -> bytes
```

| | |
| --- | --- |
| Kind | scalar |
| Signature class | `scalar/ternary` |
| Returns | `bytes` |
| Aliases | `hmac` |
| Streaming | Continuous — evaluated per row with no retained state. |
| Determinism | Deterministic — the same arguments always give the same result. |
| NULL handling | Any NULL argument gives NULL. |

Arguments are a constant algorithm name, key and message, with supported names sha256, sha384 and sha512. It returns raw authentication bytes and treats string keys and messages as UTF-8. NULL arguments yield NULL; unknown algorithms raise INVALID_ARGUMENT and incompatible key/message types raise TYPE_MISMATCH.

**Example**

```sql
length(hash_hmac('sha256', 'key', 'message'))
-- → 32
```

## hash_int_32

Scrambles one integer into a compact unsigned 32-bit hash value.

```text
hash_int_32(I) -> uint32
```

| | |
| --- | --- |
| Kind | scalar |
| Signature class | `scalar/unary` |
| Returns | `uint32` |
| Aliases | `int_hash32` |
| Streaming | Continuous — evaluated per row with no retained state. |
| Determinism | Deterministic — the same arguments always give the same result. |
| NULL handling | Any NULL argument gives NULL. |

Applies the catalog’s pinned integer-only mixing function without treating the input as decimal text. The uint32 result may collide even when source integers are distinct. SQL NULL returns NULL and noninteger arguments raise TYPE_MISMATCH; this operation is intended for fast distribution rather than cryptographic protection.

**Example**

```sql
hash_int_32(42) = hash_int_32(42)
-- → true
```

## hash_int_64

Derives an unsigned 64-bit mixing value directly from an integer.

```text
hash_int_64(I) -> uint64
```

| | |
| --- | --- |
| Kind | scalar |
| Signature class | `scalar/unary` |
| Returns | `uint64` |
| Aliases | `int_hash64` |
| Streaming | Continuous — evaluated per row with no retained state. |
| Determinism | Deterministic — the same arguments always give the same result. |
| NULL handling | Any NULL argument gives NULL. |

Uses the versioned integer mixer to spread the input’s representation over a uint64 result. It does not promise reversibility or a collision-free mapping of wide integers. NULL propagates, incompatible noninteger types raise TYPE_MISMATCH, and repeated equal typed inputs produce the same result.

**Example**

```sql
hash_int_64(17) = hash_int_64(17)
-- → true
```

## hash_java

Reproduces Java string hash codes using UTF-16 code units and wrapped signed arithmetic.

```text
hash_java(string) -> int32
```

| | |
| --- | --- |
| Kind | scalar |
| Signature class | `scalar/unary` |
| Returns | `int32` |
| Aliases | `java_hash` |
| Streaming | Continuous — evaluated per row with no retained state. |
| Determinism | Deterministic — the same arguments always give the same result. |
| NULL handling | Any NULL argument gives NULL. |

Accumulates UTF-16 code units with the Java polynomial multiplier 31 and 32-bit wraparound. The returned int32 can be negative; supplementary Unicode characters contribute a surrogate pair. NULL yields NULL, empty text hashes to zero, and a nonstring argument raises TYPE_MISMATCH.

**Example**

```sql
hash_java('abc')
-- → 96354
```

## hash_keccak256

Returns the Keccak-256 digest, using the pre-standardization padding convention.

```text
hash_keccak256(bytes|string) -> fixed_string(32)
```

| | |
| --- | --- |
| Kind | scalar |
| Signature class | `scalar/unary` |
| Returns | `fixed_string(32)` |
| Aliases | `keccak256` |
| Streaming | Continuous — evaluated per row with no retained state. |
| Determinism | Deterministic — the same arguments always give the same result. |
| NULL handling | Any NULL argument gives NULL. |

Generates thirty-two raw digest bytes in fixed_string(32) from binary or UTF-8 input. Keccak padding distinguishes this function from SHA3-256, so the algorithms are not interchangeable. SQL NULL propagates and incompatible message types raise TYPE_MISMATCH; no hexadecimal rendering is implicit.

**Example**

```sql
length(hash_keccak256('abc'))
-- → 32
```

## hash_md5

Returns the sixteen raw MD5 digest bytes for a string or binary message.

```text
hash_md5(bytes|string) -> fixed_string(16)
```

| | |
| --- | --- |
| Kind | scalar |
| Signature class | `scalar/unary` |
| Returns | `fixed_string(16)` |
| Aliases | `md5` |
| Streaming | Continuous — evaluated per row with no retained state. |
| Determinism | Deterministic — the same arguments always give the same result. |
| NULL handling | Any NULL argument gives NULL. |

Hashes bytes directly and hashes strings through their UTF-8 representation. The fixed_string(16) result is binary, including for the empty message, rather than thirty-two hexadecimal characters. NULL remains NULL and a wrong argument type raises TYPE_MISMATCH; MD5 is retained for compatibility without a collision-resistance claim.

**Example**

```sql
hex_encode(hash_md5('abc'))
-- → '900150983CD24FB0D6963F7D28E17F72'
```

## hash_murmur_2_32

Calculates MurmurHash2’s 32-bit variant over a structured value sequence.

```text
hash_murmur_2_32(T,...) -> uint32
```

| | |
| --- | --- |
| Kind | scalar |
| Signature class | `scalar/variadic+generic` |
| Returns | `uint32` |
| Aliases | `murmur_hash2_32` |
| Streaming | Continuous — evaluated per row with no retained state. |
| Determinism | Deterministic — the same arguments always give the same result. |
| NULL handling | Any NULL argument gives NULL. |

Encodes each argument with its logical type before applying the pinned 32-bit MurmurHash2 routine. Result bits are returned as uint32, avoiding interpretation as a signed application identifier. Any SQL NULL returns NULL; incompatible encodings raise TYPE_MISMATCH and the algorithm offers no cryptographic guarantee.

**Example**

```sql
hash_murmur_2_32('order', 5) = hash_murmur_2_32('order', 5)
-- → true
```

## hash_murmur_2_64

Returns the wide MurmurHash2 fingerprint for canonical typed inputs.

```text
hash_murmur_2_64(T,...) -> uint64
```

| | |
| --- | --- |
| Kind | scalar |
| Signature class | `scalar/variadic+generic` |
| Returns | `uint64` |
| Aliases | `murmur_hash2_64` |
| Streaming | Continuous — evaluated per row with no retained state. |
| Determinism | Deterministic — the same arguments always give the same result. |
| NULL handling | Any NULL argument gives NULL. |

Applies the specified 64-bit MurmurHash2 variant to the ordered argument encoding. Reordering arguments or changing their logical descriptors can change the resulting uint64. NULL propagates through the whole call; TYPE_MISMATCH rejects unencodable input, and fingerprint equality does not establish value equality.

**Example**

```sql
hash_murmur_2_64('temperature', 20) = hash_murmur_2_64('temperature', 20)
-- → true
```

## hash_murmur_3_128

Generates sixteen raw fingerprint bytes using MurmurHash3 over typed values.

```text
hash_murmur_3_128(T,...) -> fixed_string(16)
```

| | |
| --- | --- |
| Kind | scalar |
| Signature class | `scalar/variadic+generic` |
| Returns | `fixed_string(16)` |
| Aliases | `murmur_hash3_128` |
| Streaming | Continuous — evaluated per row with no retained state. |
| Determinism | Deterministic — the same arguments always give the same result. |
| NULL handling | Any NULL argument gives NULL. |

Returns the 128-bit MurmurHash3 result as fixed_string(16), not as hexadecimal display text. The argument order and logical descriptors are part of the hashed representation. NULL propagates, incompatible types raise TYPE_MISMATCH, and callers needing readable digits must explicitly encode the raw output.

**Example**

```sql
length(hash_murmur_3_128('reading', 4))
-- → 16
```

## hash_murmur_3_32

Compresses canonically serialized arguments with the 32-bit MurmurHash3 algorithm.

```text
hash_murmur_3_32(T,...) -> uint32
```

| | |
| --- | --- |
| Kind | scalar |
| Signature class | `scalar/variadic+generic` |
| Returns | `uint32` |
| Aliases | `murmur_hash3_32` |
| Streaming | Continuous — evaluated per row with no retained state. |
| Determinism | Deterministic — the same arguments always give the same result. |
| NULL handling | Any NULL argument gives NULL. |

Produces the uint32 MurmurHash3 variant from argument values together with their type boundaries. This is a deterministic distribution hash whose variant and seed belong to the catalog contract. A NULL input yields NULL, and incompatible types raise TYPE_MISMATCH instead of falling back to string formatting.

**Example**

```sql
hash_murmur_3_32('humidity', 60) = hash_murmur_3_32('humidity', 60)
-- → true
```

## hash_murmur_3_64

Computes a 64-bit MurmurHash3 result from the ordered argument encoding.

```text
hash_murmur_3_64(T,...) -> uint64
```

| | |
| --- | --- |
| Kind | scalar |
| Signature class | `scalar/variadic+generic` |
| Returns | `uint64` |
| Aliases | `murmur_hash3_64` |
| Streaming | Continuous — evaluated per row with no retained state. |
| Determinism | Deterministic — the same arguments always give the same result. |
| NULL handling | Any NULL argument gives NULL. |

Uses the catalog’s fixed MurmurHash3 64-bit compatibility routine and returns uint64. Typed encoding keeps argument boundaries explicit and supports stable repeated evaluation. SQL NULL in any position returns NULL; inadmissible encodings raise TYPE_MISMATCH, and the result is not a cryptographic digest.

**Example**

```sql
hash_murmur_3_64('pressure', 1000) = hash_murmur_3_64('pressure', 1000)
-- → true
```

## hash_sha1

Builds a twenty-byte SHA-1 compatibility digest from message bytes.

```text
hash_sha1(bytes|string) -> fixed_string(20)
```

| | |
| --- | --- |
| Kind | scalar |
| Signature class | `scalar/unary` |
| Returns | `fixed_string(20)` |
| Aliases | `sha1` |
| Streaming | Continuous — evaluated per row with no retained state. |
| Determinism | Deterministic — the same arguments always give the same result. |
| NULL handling | Any NULL argument gives NULL. |

Produces SHA-1 output in fixed_string(20), using UTF-8 when the message is supplied as a string. Empty input has its normal digest and must not be confused with SQL NULL, which propagates. Incompatible message types raise TYPE_MISMATCH; the raw result requires explicit encoding for a hexadecimal display.

**Example**

```sql
hex_encode(hash_sha1('abc'))
-- → 'A9993E364706816ABA3E25717850C26C9CD0D89D'
```

## hash_sha224

Derives the SHA-224 digest as twenty-eight binary bytes.

```text
hash_sha224(bytes|string) -> fixed_string(28)
```

| | |
| --- | --- |
| Kind | scalar |
| Signature class | `scalar/unary` |
| Returns | `fixed_string(28)` |
| Aliases | `sha224` |
| Streaming | Continuous — evaluated per row with no retained state. |
| Determinism | Deterministic — the same arguments always give the same result. |
| NULL handling | Any NULL argument gives NULL. |

Applies SHA-224 to the complete input byte sequence and returns fixed_string(28). Text is interpreted as UTF-8 without normalization, so canonically equivalent Unicode spellings may hash differently. SQL NULL produces NULL and incompatible logical types raise TYPE_MISMATCH; encoding the digest for display is explicit.

**Example**

```sql
length(hash_sha224('abc'))
-- → 28
```

## hash_sha256

Returns a 256-bit SHA-2 digest of binary data or UTF-8 text.

```text
hash_sha256(bytes|string) -> fixed_string(32)
```

| | |
| --- | --- |
| Kind | scalar |
| Signature class | `scalar/unary` |
| Returns | `fixed_string(32)` |
| Aliases | `sha256` |
| Streaming | Continuous — evaluated per row with no retained state. |
| Determinism | Deterministic — the same arguments always give the same result. |
| NULL handling | Any NULL argument gives NULL. |

Computes SHA-256 over the supplied bytes and exposes all thirty-two digest bytes in fixed_string(32). No text normalization or implicit hexadecimal formatting is performed. A NULL message yields NULL, while incompatible argument types raise TYPE_MISMATCH; the empty message is a valid hash input.

**Example**

```sql
hex_encode(hash_sha256('abc'))
-- → 'BA7816BF8F01CFEA414140DE5DAE2223B00361A396177A9CB410FF61F20015AD'
```

## hash_sha384

Calculates SHA-384 and exposes its forty-eight-byte binary digest.

```text
hash_sha384(bytes|string) -> fixed_string(48)
```

| | |
| --- | --- |
| Kind | scalar |
| Signature class | `scalar/unary` |
| Returns | `fixed_string(48)` |
| Aliases | `sha384` |
| Streaming | Continuous — evaluated per row with no retained state. |
| Determinism | Deterministic — the same arguments always give the same result. |
| NULL handling | Any NULL argument gives NULL. |

Uses the SHA-384 initialization and compression rules over bytes or a string’s UTF-8 encoding. The result retains every output byte, including zero bytes, in fixed_string(48). NULL propagates and other input types raise TYPE_MISMATCH; a readable hexadecimal representation would contain ninety-six digits.

**Example**

```sql
length(hash_sha384('abc'))
-- → 48
```

## hash_sha512

Hashes a message with SHA-512 to obtain sixty-four raw bytes.

```text
hash_sha512(bytes|string) -> fixed_string(64)
```

| | |
| --- | --- |
| Kind | scalar |
| Signature class | `scalar/unary` |
| Returns | `fixed_string(64)` |
| Aliases | `sha512` |
| Streaming | Continuous — evaluated per row with no retained state. |
| Determinism | Deterministic — the same arguments always give the same result. |
| NULL handling | Any NULL argument gives NULL. |

Consumes the exact byte message, or UTF-8 text bytes, and returns fixed_string(64). The output is the complete SHA-512 digest rather than a shortened checksum. SQL NULL returns NULL; incompatible types raise TYPE_MISMATCH, and callers must choose an explicit representation when exporting the binary result.

**Example**

```sql
length(hash_sha512('abc'))
-- → 64
```

## hash_sha512_256

Computes the distinct SHA-512/256 construction for a thirty-two-byte result.

```text
hash_sha512_256(bytes|string) -> fixed_string(32)
```

| | |
| --- | --- |
| Kind | scalar |
| Signature class | `scalar/unary` |
| Returns | `fixed_string(32)` |
| Aliases | `sha512_256` |
| Streaming | Continuous — evaluated per row with no retained state. |
| Determinism | Deterministic — the same arguments always give the same result. |
| NULL handling | Any NULL argument gives NULL. |

Applies the specified SHA-512/256 initialization values and returns fixed_string(32). This is not equivalent to truncating an ordinary SHA-512 digest, even though both use related compression machinery. NULL remains NULL and incompatible message types raise TYPE_MISMATCH; strings contribute their unnormalized UTF-8 bytes.

**Example**

```sql
length(hash_sha512_256('abc'))
-- → 32
```

## hash_sip_128

Emits a sixteen-byte SipHash result for a sequence of structured arguments.

```text
hash_sip_128(T,...) -> fixed_string(16)
```

| | |
| --- | --- |
| Kind | scalar |
| Signature class | `scalar/variadic+generic` |
| Returns | `fixed_string(16)` |
| Aliases | `sip_hash128`, `sipHash128` |
| Streaming | Continuous — evaluated per row with no retained state. |
| Determinism | Deterministic — the same arguments always give the same result. |
| NULL handling | Any NULL argument gives NULL. |

The pinned 128-bit variant hashes canonical typed inputs and returns fixed_string(16). Byte layout and variant are fixed by compatibility vectors rather than inferred from host integer endianness. NULL arguments produce NULL; incompatible encodings raise TYPE_MISMATCH, and display formatting is a separate operation.

**Example**

```sql
length(hash_sip_128('sensor', 2))
-- → 16
```

## hash_sip_64

Evaluates fixed-seed SipHash over one or more canonical SQL values.

```text
hash_sip_64(T,...) -> uint64
```

| | |
| --- | --- |
| Kind | scalar |
| Signature class | `scalar/variadic+generic` |
| Returns | `uint64` |
| Aliases | `sip_hash64`, `sipHash64` |
| Streaming | Continuous — evaluated per row with no retained state. |
| Determinism | Deterministic — the same arguments always give the same result. |
| NULL handling | Any NULL argument gives NULL. |

Produces uint64 with the SQL function’s documented fixed seed and compatibility variant. The seed is not a user secret, so the output must not be used as an authentication tag. Every NULL argument yields NULL, while incompatible typed encodings raise TYPE_MISMATCH.

**Example**

```sql
hash_sip_64('sample', 6) = hash_sip_64('sample', 6)
-- → true
```

## hash_xx_32

Creates a compact xxHash32 fingerprint from typed arguments.

```text
hash_xx_32(T,...) -> uint32
```

| | |
| --- | --- |
| Kind | scalar |
| Signature class | `scalar/variadic+generic` |
| Returns | `uint32` |
| Aliases | `xx_hash32`, `xxHash32` |
| Streaming | Continuous — evaluated per row with no retained state. |
| Determinism | Deterministic — the same arguments always give the same result. |
| NULL handling | Any NULL argument gives NULL. |

Processes the canonical serialization with the fixed xxHash32 algorithm and returns uint32. This fast checksum can support partition selection but does not make unequal values collision-free. NULL in any argument returns NULL, and unencodable types raise TYPE_MISMATCH.

**Example**

```sql
hash_xx_32('item', 9) = hash_xx_32('item', 9)
-- → true
```

## hash_xx_64

Computes the classic xxHash64 checksum over canonical value encodings.

```text
hash_xx_64(T,...) -> uint64
```

| | |
| --- | --- |
| Kind | scalar |
| Signature class | `scalar/variadic+generic` |
| Returns | `uint64` |
| Aliases | `xx_hash64`, `xxHash64` |
| Streaming | Continuous — evaluated per row with no retained state. |
| Determinism | Deterministic — the same arguments always give the same result. |
| NULL handling | Any NULL argument gives NULL. |

Returns a uint64 using the classic 64-bit xxHash routine, with argument boundaries preserved by serialization. The operation is deterministic but deliberately noncryptographic. SQL NULL propagates; an incompatible descriptor raises TYPE_MISMATCH instead of being hashed through locale-dependent text.

**Example**

```sql
hash_xx_64('batch', 8) = hash_xx_64('batch', 8)
-- → true
```

## hash_xxh3

Fingerprints typed SQL values with the newer 64-bit XXH3 algorithm.

```text
hash_xxh3(T,...) -> uint64
```

| | |
| --- | --- |
| Kind | scalar |
| Signature class | `scalar/variadic+generic` |
| Returns | `uint64` |
| Aliases | `xxh3` |
| Streaming | Continuous — evaluated per row with no retained state. |
| Determinism | Deterministic — the same arguments always give the same result. |
| NULL handling | Any NULL argument gives NULL. |

Uses the pinned XXH3 64-bit routine rather than the classic xxHash64 algorithm. It hashes the canonical argument stream, so its result is repeatable for identical typed values but may differ from other xxHash variants. NULL returns NULL and unencodable arguments raise TYPE_MISMATCH; no cryptographic resistance is claimed.

**Example**

```sql
hash_xxh3('reading', 11) = hash_xxh3('reading', 11)
-- → true
```

---

Source: https://nyxdb.io/docs/functions/hash/
