libcoap  4.1.2
Macros | Typedefs | Functions
hashkey.h File Reference

definition of hash key type and helper functions More...

#include "str.h"
Include dependency graph for hashkey.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define coap_hash(String, Length, Result)   coap_hash_impl((String),(Length),(Result))
 
#define __COAP_DEFAULT_HASH
 
#define coap_str_hash(Str, H)
 Calls coap_hash() with given str object as parameter. More...
 

Typedefs

typedef unsigned char coap_key_t[4]
 

Functions

void coap_hash_impl (const unsigned char *s, unsigned int len, coap_key_t h)
 Calculates a fast hash over the given string s of length len and stores the result into h. More...
 

Detailed Description

definition of hash key type and helper functions

Definition in file hashkey.h.

Macro Definition Documentation

§ __COAP_DEFAULT_HASH

#define __COAP_DEFAULT_HASH

Definition at line 38 of file hashkey.h.

§ coap_hash

#define coap_hash (   String,
  Length,
  Result 
)    coap_hash_impl((String),(Length),(Result))

Definition at line 34 of file hashkey.h.

§ coap_str_hash

#define coap_str_hash (   Str,
 
)

Calls coap_hash() with given str object as parameter.

Parameters
StrMust contain a pointer to a coap string object.
HA coap_key_t object to store the result.

Definition at line 51 of file hashkey.h.

Typedef Documentation

§ coap_key_t

typedef unsigned char coap_key_t[4]

Definition at line 20 of file hashkey.h.

Function Documentation

§ coap_hash_impl()

void coap_hash_impl ( const unsigned char *  s,
unsigned int  len,
coap_key_t  h 
)

Calculates a fast hash over the given string s of length len and stores the result into h.

Depending on the exact implementation, this function cannot be used as one-way function to check message integrity or simlar.

Parameters
sThe string used for hash calculation.
lenThe length of s.
hThe result buffer to store the calculated hash key.

Definition at line 15 of file hashkey.c.