From cd355ea1f096c3fe6b23ab499f7fdc6af5b8aef4 Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Wed, 12 Dec 2018 11:13:11 +0000 Subject: [PATCH] Obsolete hasval.c --- base/modules/aux/psb_hashval.c | 49 ---------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 base/modules/aux/psb_hashval.c diff --git a/base/modules/aux/psb_hashval.c b/base/modules/aux/psb_hashval.c deleted file mode 100644 index 15cfc448..00000000 --- a/base/modules/aux/psb_hashval.c +++ /dev/null @@ -1,49 +0,0 @@ -#include -/* - This is based on the djb2 hashing algorithm - see e.g. http://www.cse.yorku.ca/~oz/hash.html -*/ - -#define IVAL 5381 -#define H32MASK 0x7FFFFFFF -#define H64MASK 0x7FFFFFFFFFFFFFFF -#define BMASK 0xFF - -int32_t psb_c_hashval_32(int32_t inkey) -{ - uint32_t key, val, i; - key = inkey; - val = IVAL; - for (i=0; i<4; i++) { - val = ((val<<5)+val)+(key & BMASK); - key >>= 8; - } - val &= H32MASK; - return(val); -} - -int64_t psb_c_hashval_64(int64_t inkey) -{ - uint64_t key, val, i; - key = inkey; - val = IVAL; - for (i=0; i<8; i++) { - val = ((val<<5)+val)+(key & BMASK); - key >>= 8; - } - val &= H64MASK; - return(val); -} - -int32_t psb_c_hashval_64_32(int64_t inkey) -{ - uint32_t key, val, i; - key = inkey; - val = IVAL; - for (i=0; i<8; i++) { - val = ((val<<5)+val)+(key & BMASK); - key >>= 8; - } - val &= H32MASK; - return(val); -}