summaryrefslogtreecommitdiff
path: root/common/oid.c
diff options
context:
space:
mode:
authorStef Walter <stefw@gnome.org>2013-03-20 09:33:04 +0100
committerStef Walter <stefw@gnome.org>2013-03-20 10:54:00 +0100
commitf45942a4fc3e1c5219e9b5201b82203337ee7280 (patch)
treef83313676d1c8de9dbc48d161e16c13264bc8049 /common/oid.c
parent1dc227b4fce16fcc721276925492f4ba4db00b4f (diff)
hash: Add the murmur2 hash and start using it
Add implementation of the murmur2 hash function, and start using it for our dictionaries. Our implementation is incremental like our other hash functions. Also remove p11_oid_hash() which wasn't being used. In addition fix several tests whose success was based on the way that the dictionary hashed. This was a hidden testing bug.
Diffstat (limited to 'common/oid.c')
-rw-r--r--common/oid.c17
1 files changed, 0 insertions, 17 deletions
diff --git a/common/oid.c b/common/oid.c
index 0c876ec..b4b0bf6 100644
--- a/common/oid.c
+++ b/common/oid.c
@@ -60,23 +60,6 @@ p11_oid_simple (const unsigned char *oid,
(size_t)oid[1] == len - 2); /* matches length */
}
-unsigned int
-p11_oid_hash (const void *oid)
-{
- const unsigned char *v = oid;
- unsigned int hash;
- int len;
- int i;
-
- len = p11_oid_length (v);
- hash = v[0];
-
- for (i = 1; i < len; i++)
- hash = (hash << 5) - hash + v[i];
-
- return hash;
-}
-
bool
p11_oid_equal (const void *oid_one,
const void *oid_two)