Skip to content

xxHash functions in the Hashfuncs DuckDB extension

Function category

xxHash

5 functions

xxh3_128

Scalar function xxHash
Signature
2 overloaded forms · click to inspect
Arguments (Positional)
Argument value Type ANY Mode Positional Description
Description
1 128-bit hash
SELECT xxh3_128('hello world');

Output

xxh3_128('hello world')
225447084758876380551077147957698971904
2 Seeded
SELECT xxh3_128('hello world', 42);

Output

xxh3_128('hello world', 42)
173805935617512661584987041130904516770

xxh3_128_hex

Scalar function xxHash
Signature
4 overloaded forms · click to inspect
Arguments (Positional)
Argument col0 Type BLOB Mode Positional Description
Description
1 32-char hex digest
SELECT xxh3_128_hex('hello');

Output

xxh3_128_hex('hello')
b5e9c1ad071b3e7fc779cfaa5e523818
2 Seeded variant
SELECT xxh3_128_hex('hello', 42);

Output

xxh3_128_hex('hello', 42)
6ce89a0bdba81f088c2f5b7e4cd59e16

xxh3_64

Scalar function xxHash
Signature
2 overloaded forms · click to inspect
Arguments (Positional)
Argument value Type ANY Mode Positional Description
Description
1 Default unseeded
SELECT xxh3_64('hello world');

Output

xxh3_64('hello world')
15296390279056496779
2 Seeded for partitioning
SELECT xxh3_64('hello world', 999);

Output

xxh3_64('hello world', 999)
3002856137354040482

xxh32

Scalar function xxHash
Signature
2 overloaded forms · click to inspect
Arguments (Positional)
Argument value Type ANY Mode Positional Description
Description
1 Hash a string
SELECT xxh32('hello world');

Output

xxh32('hello world')
3468387874
2 Seeded variant — independent hash space
SELECT xxh32('hello world', 42);

Output

xxh32('hello world', 42)
4225033588

xxh64

Scalar function xxHash
Signature
2 overloaded forms · click to inspect
Arguments (Positional)
Argument value Type ANY Mode Positional Description
Description
1 64-bit hash of a string
SELECT xxh64('hello world');

Output

xxh64('hello world')
5020219685658847592
2 Seeded
SELECT xxh64('hello world', 42);

Output

xxh64('hello world', 42)
7620854247404556961