Skip to content

fabriziomello/pg_xxhash

Repository files navigation

pg_xxhash

xxHash functions for PostgreSQL.

Supported PostgreSQL versions

The aim of the project is support as many community-supported major versions of Postgres as possible. Currently, the following versions of PostgreSQL are supported:

11, 12, 13, 14, 15 and 16.

Dependencies

$ sudo apt install libxxhash-dev

Installation from source

$ git clone https://github.com/fabriziomello/pg_xxhash.git
$ cd pg_xxhash
# Make sure your path includes the bin directory that contains the correct `pg_config`
$ PATH=/path/to/pg/bin:$PATH
$ USE_PGXS=1 make
$ USE_PGXS=1 make install

Regression Tests

$ USE_PGXS=1 make installcheck

Examples

CREATE EXTENSION pg_xxhash;

-- Testing using default seed = 0
SELECT pg_xxhash64('foo');
     pg_xxhash64     
---------------------
 3728699739546630719
(1 row)

SELECT pg_xxhash64('foo', 0);
     pg_xxhash64     
---------------------
 3728699739546630719
(1 row)

-- Testing using an specific seeds
SELECT pg_xxhash64('foo', 100);
     pg_xxhash64     
---------------------
 4679220945261188543
(1 row)

Please feel free to open a PR.

Authors

License

PostgreSQL server source code, used under the PostgreSQL license.
Portions Copyright (c) 1996-2023, The PostgreSQL Global Development Group
Portions Copyright (c) 1994, The Regents of the University of California

All other parts are licensed under the Apache License Version 2.0, see LICENSE file for details.
Copyright (c) 2023, Fabrízio de Royes Mello fabriziomello@gmail.com

About

xxHash functions for PostgreSQL

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published