From f45942a4fc3e1c5219e9b5201b82203337ee7280 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Wed, 20 Mar 2013 09:33:04 +0100 Subject: 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. --- common/oid.c | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'common/oid.c') 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) -- cgit v1.1