Skip to content

Commit 89645f1

Browse files
author
Yury Frolov
committed
Update README, copyright, etc.
1 parent 0bd605d commit 89645f1

File tree

6 files changed

+42
-120
lines changed

6 files changed

+42
-120
lines changed

COPYRIGHT

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,12 @@
11

22
Files under public domain:
33

4-
- inthash.c
5-
- lookup2.c
6-
- lookup3.c
74
- murmur3.c
8-
- spooky.c
95

106
Files under PostgreSQL License:
117

12-
- crc32.c
13-
- pgsql84.c
14-
- pgspqrhash.c
15-
- pgspqrhash.h
16-
17-
Files under MIT license:
18-
19-
- city.c
20-
21-
Files under ISC license:
22-
23-
- md5.c
24-
8+
- spqrhash.c
9+
- spqrhash.h
2510

2611
PostgreSQL license
2712
------------------

README.rst

Lines changed: 3 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
1-
pgspqrhash
1+
spqrhash
22
=========
33

4-
The goal of pgspqrhash is to provide stable hashes for PostgeSQL,
5-
"stable" in the sense that their implementation does not change,
6-
they are independent from PostgeSQL version.
7-
8-
Some string hashes may be dependent on CPU architecture,
9-
so that they return different return on big-endian
10-
architecture from little-endian architecture.
11-
It you want to be architectures-independent, then
12-
use algorithms that don't depend on endianess.
4+
The extension provides hash funcitons for SPQR to work with PG.
135

146

157
Installation
@@ -25,17 +17,6 @@ You need PostgreSQL developent environment. Then simply::
2517
Functions
2618
---------
2719

28-
hash_string
29-
~~~~~~~~~~~
30-
31-
::
32-
33-
hash_string(data text, algo text [, initval int4]) returns int4
34-
hash_string(data bytea, algo text [, initval int4]) returns int4
35-
36-
This hashes the data with specified algorithm, returns 32-bit result.
37-
38-
3920
hash64_string
4021
~~~~~~~~~~~~~
4122

@@ -46,27 +27,6 @@ hash64_string
4627

4728
Uses same algorithms as `hash_string()` but returns 64-bit result.
4829

49-
hash128_string
50-
~~~~~~~~~~~~~~
51-
52-
::
53-
54-
hash64_string(data text, algo text, [, initval int4]) returns int8
55-
hash64_string(data byte, algo text, [, initval int4]) returns int8
56-
57-
Uses same algorithms as `hash_string()` but returns 128-bit result.
58-
59-
60-
hash_int4
61-
~~~~~~~~~
62-
63-
::
64-
65-
hash_int4(val int4) returns int4
66-
67-
Hash 32-bit integer.
68-
69-
7030
hash_int8
7131
~~~~~~~~~
7232

@@ -78,26 +38,15 @@ Hash 64-bit integer.
7838

7939

8040

81-
String hashing algorithms
41+
Hashing algorithms
8242
-------------------------
8343

8444
List of currently provided algorithms.
8545

8646
============== ========= ====== ======= ======= ==============================
8747
Algorithm CPU-indep Bits IV bits Partial Description
8848
============== ========= ====== ======= ======= ==============================
89-
city64 no 64 64 no CityHash64
90-
city128 no 128 128 no CityHash128
91-
crc32 yes 32 32 yes CRC32
92-
lookup2 no 64 32 no Jenkins lookup2
93-
lookup3be yes 64 32 no Jenkins lookup3 big-endian
94-
lookup3le yes 64 32 no Jenkins lookup3 little-endian
95-
lookup3 no 64 32 no Jenkins lookup3 CPU-native
9649
murmur3 no 32 32 no MurmurHash v3, 32-bit variant
97-
md5 yes 128 128 no MD5
98-
pgsql84 no 64 0 no Hacked lookup3 in Postgres 8.4+
99-
siphash24 yes 64 128 no SipHash-2-4
100-
spooky no 128 128 no SpookyHash
10150
============== ========= ====== ======= ======= ==============================
10251

10352
CPU-independence
@@ -117,54 +66,9 @@ Partial hashing
11766
Whether long string can be hashed in smaller parts, by giving last
11867
value as initval to next hash call.
11968

120-
Integer hashing algorithms
121-
--------------------------
122-
123-
============== ====== ================================ ============================
124-
Algorithm Bits Description Notes
125-
============== ====== ================================ ============================
126-
wang32 32 Thomas Wang hash32shift
127-
wang32mult 32 Thomas Wang hash32shiftmult
128-
jenkins 32 Bob Jenkins hash with 6 shifts
129-
wang64 64 Thomas Wang hash64shift
130-
wang64to32 64 Thomas Wang hash6432shift Result can be cast to int4
131-
============== ====== ================================ ============================
132-
133-
All algorithms here have the property that they are "reversible",
134-
that means there is 1:1 mapping between input and output.
135-
136-
This propery is useful for creating well-defined "random" sort order over
137-
unique integer id's. Or picking up random row from table
138-
with unique id's.
139-
140-
14169
Links
14270
-----
14371

144-
* `Lookup2/3 hashes`__ by Bob Jenkins.
145-
146-
.. __: http://burtleburtle.net/bob/hash/doobs.html
147-
14872
* `MurmurHash`__ by Austin Appleby.
14973

15074
.. __: http://code.google.com/p/smhasher/
151-
152-
* `Integer hashes`__ by Bob Jenkins.
153-
154-
.. __: http://burtleburtle.net/bob/hash/integer.html
155-
156-
* `Integer hashes`__ by Thomas Wang.
157-
158-
.. __: http://www.cris.com/~Ttwang/tech/inthash.htm
159-
160-
* Google's `CityHash`__. 64/128/256-bit output.
161-
162-
.. __: http://code.google.com/p/cityhash/
163-
164-
* `SpookyHash`__ by Bob Jenkins. 128-bit output.
165-
166-
.. __: http://www.burtleburtle.net/bob/hash/spooky.html
167-
168-
* `SipHash-2-4`__ by Jean-Philippe Aumasson and Daniel J. Bernstein.
169-
170-
.. __: https://131002.net/siphash/

debian/copyright

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2+
Files under public domain:
3+
4+
- murmur3.c
5+
6+
Files under PostgreSQL License:
7+
8+
- spqrhash.c
9+
- spqrhash.h
10+
11+
PostgreSQL license
12+
------------------
13+
14+
Portions Copyright (c) 1996-2011, PostgreSQL Global Development Group
15+
Portions Copyright (c) 1994, The Regents of the University of California
16+
17+
Permission to use, copy, modify, and distribute this software and its
18+
documentation for any purpose, without fee, and without a written agreement
19+
is hereby granted, provided that the above copyright notice and this
20+
paragraph and the following two paragraphs appear in all copies.
21+
22+
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
23+
DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
24+
LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
25+
DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE
26+
POSSIBILITY OF SUCH DAMAGE.
27+
28+
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
29+
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
30+
AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
31+
ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO
32+
PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
33+

debian/rules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ override_dh_auto_install:
3232

3333
.PHONY: orig realclean
3434
PKGVERS = $(shell dpkg-parsechangelog | awk -F '[:-]' '/^Version:/ { print substr($$2, 2) }')
35-
srcpkg = pgspqrhash_$(PKGVERS)
35+
srcpkg = spqrhash_$(PKGVERS)
3636
srctar = $(srcpkg).orig.tar.gz
3737
dst = ext/$(srcpkg)
3838
orig:

spqrhash.control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# spqrhash extension
2-
comment = 'Stable hash functions'
2+
comment = 'SPQR hash functions'
33
default_version = '1.0'
44
module_pathname = '$libdir/spqrhash'
55
relocatable = true

src/spqrhash.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef _PGspqrhash_H_
2-
#define _PGspqrhash_H_
1+
#ifndef _SPQRHash_H_
2+
#define _SPQRHash_H_
33

44
#include <postgres.h>
55
#include <fmgr.h>

0 commit comments

Comments
 (0)