From 84c96b3c3df40b3255d436150990143a642e5abd Mon Sep 17 00:00:00 2001 From: yuchen Date: Wed, 15 Apr 2015 12:49:01 +0800 Subject: [PATCH] delete hash.c --- .../lab4/lab4-spoc-discuss/libs/hash.c | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 related_info/lab4/lab4-spoc-discuss/libs/hash.c diff --git a/related_info/lab4/lab4-spoc-discuss/libs/hash.c b/related_info/lab4/lab4-spoc-discuss/libs/hash.c deleted file mode 100644 index 61bcd88..0000000 --- a/related_info/lab4/lab4-spoc-discuss/libs/hash.c +++ /dev/null @@ -1,18 +0,0 @@ -#include - -/* 2^31 + 2^29 - 2^25 + 2^22 - 2^19 - 2^16 + 1 */ -#define GOLDEN_RATIO_PRIME_32 0x9e370001UL - -/* * - * hash32 - generate a hash value in the range [0, 2^@bits - 1] - * @val: the input value - * @bits: the number of bits in a return value - * - * High bits are more random, so we use them. - * */ -uint32_t -hash32(uint32_t val, unsigned int bits) { - uint32_t hash = val * GOLDEN_RATIO_PRIME_32; - return (hash >> (32 - bits)); -} -