libcoap  4.1.1
 All Data Structures Files Functions Variables Typedefs Macros Groups Pages
Macros | Typedefs | Functions
hashkey.h File Reference

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

#include "str.h"

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

#define __COAP_DEFAULT_HASH

Definition at line 38 of file hashkey.h.

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

Definition at line 34 of file hashkey.h.

#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

typedef unsigned char coap_key_t[4]

Definition at line 19 of file hashkey.h.

Function Documentation

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.