libdatatypes 0.3.2
Abstract datatypes for C.
Loading...
Searching...
No Matches
hash.c File Reference

Hash functions. More...

#include <stdio.h>
#include <assert.h>
#include "hash.h"

Go to the source code of this file.

Functions

uint32_t str_hash (const void *ptr)
 
uint32_t direct_hash (const void *ptr)
 

Detailed Description

Hash functions.

Author
Sebastian Fedrau sebas.nosp@m.tian.nosp@m..fedr.nosp@m.au@g.nosp@m.mail..nosp@m.com

Definition in file hash.c.

Function Documentation

◆ direct_hash()

uint32_t direct_hash ( const void *  ptr)
Parameters
ptrpointer to convert
Returns
hash digest

Converts a pointer to a hash value.

Definition at line 44 of file hash.c.

◆ str_hash()

uint32_t str_hash ( const void *  ptr)
Parameters
ptrpointer to a string
Returns
hash digest

Calculates the hash digest of a string.

Definition at line 28 of file hash.c.