A hashmap implementation in C11 with djb2 hash function
The hashmap algorithm consist of a bucket with a pair of key and values and a hash value that will to index the address of the correct bucket
Some implementations added a Linked List to solve the Hash Collision problem
Just type
mkdir build
cd build
cmake ..
./map 2> /dev/null
The default hash algorithm
/* The best string hash function, created by Dan Bernstein */
unsigned long djb2_hash (unsigned char *str)
{
unsigned long hash = 5381;
int c;
while ((c = *str++))
/* HASH * 33 + C */
hash = ((hash << 5) + hash) + c;
return hash;
}