data-structures-c
Loading...
Searching...
No Matches
fnvhash.h File Reference

FNV-1a hashing function. More...

#include <stdint.h>
#include <stdlib.h>

Go to the source code of this file.

Functions

static uint32_t fnvhash_32_str (const char *char_p)
 Get the FNV-1a 32-bit hash of a char array (ending with a \0).
 
static uint32_t fnvhash_32 (const uint8_t *char_p, const size_t length)
 Get the FNV-1a 32-bit hash of a string of bytes.
 

Detailed Description

FNV-1a hashing function.

Note
FNV-1a is not a cryptographic hashing function.

Source:

Function Documentation

◆ fnvhash_32()

static uint32_t fnvhash_32 ( const uint8_t * char_p,
const size_t length )
inlinestatic

Get the FNV-1a 32-bit hash of a string of bytes.

Parameters
[in]char_pPointer to the string of bytes.
[in]lengthNumber of bytes.
Returns
A 32-bit hash of the bytes.

◆ fnvhash_32_str()

static uint32_t fnvhash_32_str ( const char * char_p)
inlinestatic

Get the FNV-1a 32-bit hash of a char array (ending with a \0).

Parameters
[in]char_pPointer to the string of bytes.
Returns
A 32-bit hash of the bytes.