libcoap 4.3.1
|
#include <stdint.h>
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 struct murmur3_context_t 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.
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().
data | The data to hash. |
len | The actual length of data . |
Definition at line 145 of file murmur3.c.
uint32_t murmur3_32_finalize | ( | murmur3_context_t * | mctx | ) |
Finalizes the given murmur3 context mctx
and calculates the resulting murmur3 hash value.
mctx | The murmur3 context to update. |
mctx
. Definition at line 123 of file murmur3.c.
void murmur3_32_init | ( | murmur3_context_t * | mctx | ) |
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
.
mctx | The murmur3 context to update. |
data | The data to hash. |
len | The actual length of data . |
Definition at line 98 of file murmur3.c.