Libft
Custom implementation of core libc functions with additional utility helpers.
Loading...
Searching...
No Matches
hash_function.c File Reference
#include <stddef.h>
Include dependency graph for hash_function.c:

Functions

size_t hash_string (const char *key)
 Default string hash function (djb2).
 

Function Documentation

◆ hash_string()

size_t hash_string ( const char *  key)

Default string hash function (djb2).

Computes a hash over the bytes of a NUL-terminated key. The returned value is reduced modulo the bucket count by the caller.

Parameters
keyNUL-terminated key to hash (borrowed).
Returns
The computed hash value.
Here is the caller graph for this function: