libcoap 4.3.1
murmur3.h File Reference
#include <stdint.h>
+ Include dependency graph for murmur3.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  murmur3_context_t
 Naïve implementation of Murmur3 for 32 bit with update functionality. More...
 

Typedefs

typedef struct murmur3_context_t murmur3_context_t
 Naïve implementation of Murmur3 for 32 bit with update functionality. More...
 

Functions

void murmur3_32_init (murmur3_context_t *mctx)
 Initializes the provided murmur3 context object mctx. More...
 
void murmur3_32_update (murmur3_context_t *mctx, const void *data, size_t len)
 Updates the state of the murmur3 context object mctx with len bytes from data. More...
 
uint32_t murmur3_32_finalize (murmur3_context_t *mctx)
 Finalizes the given murmur3 context mctx and calculates the resulting murmur3 hash value. More...
 
uint32_t murmur3_32 (const void *data, size_t len)
 Calculcates the murmur3 hash value of data. More...
 

Typedef Documentation

◆ murmur3_context_t

Naïve implementation of Murmur3 for 32 bit with update functionality.

See https://en.wikipedia.org/wiki/MurmurHash#Algorithm and https://github.com/aappleby/smhasher/wiki/MurmurHash3

Copyright (C) 2020 Olaf Bergmann bergm.nosp@m.ann@.nosp@m.tzi.o.nosp@m.rg

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Function Documentation

◆ murmur3_32()

uint32_t murmur3_32 ( const void *  data,
size_t  len 
)

Calculcates the murmur3 hash value of data.

This is a convenience function that encapsulates the required calls to murmur3_32_init(), murmur3_32_update(), and murmur3_32_finalize().

Parameters
dataThe data to hash.
lenThe actual length of data.
Returns
The murmur3 hash value of the data.

Definition at line 145 of file murmur3.c.

+ Here is the call graph for this function:

◆ murmur3_32_finalize()

uint32_t murmur3_32_finalize ( murmur3_context_t mctx)

Finalizes the given murmur3 context mctx and calculates the resulting murmur3 hash value.

Parameters
mctxThe murmur3 context to update.
Returns
The murmur3 hash value of the data that was passed to murmur3_32_update() for the context mctx.

Definition at line 123 of file murmur3.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ murmur3_32_init()

void murmur3_32_init ( murmur3_context_t mctx)

Initializes the provided murmur3 context object mctx.

Parameters
mctxThe murmur3 context to initialize.

Definition at line 46 of file murmur3.c.

+ Here is the caller graph for this function:

◆ murmur3_32_update()

void murmur3_32_update ( murmur3_context_t mctx,
const void *  data,
size_t  len 
)

Updates the state of the murmur3 context object mctx with len bytes from data.

Parameters
mctxThe murmur3 context to update.
dataThe data to hash.
lenThe actual length of data.

Definition at line 98 of file murmur3.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: