1
/*-------------------------------------------------------------------------
4
* Hash functions for use in dynahash.c hashtables
7
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
8
* Portions Copyright (c) 1994, Regents of the University of California
12
* $PostgreSQL: pgsql/src/backend/utils/hash/hashfn.c,v 1.22 2004-12-31 22:01:37 pgsql Exp $
14
*-------------------------------------------------------------------------
18
#include "access/hash.h"
19
#include "utils/hsearch.h"
23
* string_hash: hash function for keys that are null-terminated strings.
25
* NOTE: this is the default hash function if none is specified.
28
string_hash(const void *key, Size keysize)
30
return DatumGetUInt32(hash_any((const unsigned char *) key,
31
(int) strlen((const char *) key)));
35
* tag_hash: hash function for fixed-size tag values
38
tag_hash(const void *key, Size keysize)
40
return DatumGetUInt32(hash_any((const unsigned char *) key,