소스 검색

delete hash.c

main
yuchen 9 년 전
부모
커밋
84c96b3c3d
1개의 변경된 파일0개의 추가작업 그리고 18개의 파일을 삭제
  1. +0
    -18
      related_info/lab4/lab4-spoc-discuss/libs/hash.c

+ 0
- 18
related_info/lab4/lab4-spoc-discuss/libs/hash.c 파일 보기

@ -1,18 +0,0 @@
#include <stdlib.h>
/* 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));
}

불러오는 중...
취소
저장