hash function

This commit is contained in:
2020-07-22 22:11:05 +02:00
parent ff58a623fe
commit de2c53f473
5 changed files with 16 additions and 5 deletions

6
src/hashmap.c Normal file
View File

@ -0,0 +1,6 @@
#include <math.h>
const unsigned acl_w = sizeof (unsigned) * 8;
const unsigned acl_m = 9;
unsigned hash(unsigned K) {
return (149695736*K) >> (acl_w-acl_m);
}