AceCommon  1.4.6
Arduino library for low-level common functions and features with no external dependencies
Functions
djb2.h File Reference
#include <stdint.h>
#include "../fstrings/FlashString.h"
Include dependency graph for djb2.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<typename T >
uint32_t ace_common::hashDjb2 (T s)
 Implement the djb2 hash algorithm as described in https://stackoverflow.com/questions/7666509 and http://www.cse.yorku.ca/~oz/hash.html. More...
 
template<>
uint32_t ace_common::hashDjb2 (const __FlashStringHelper *fs)
 Specialization of hashDjb2(T s) for flash strings (const __FlashStringHelper*). More...
 

Detailed Description

Implement the djb2 hash algorithm (http://www.cse.yorku.ca/~oz/hash.html) for normal strings and flash strings.

Definition in file djb2.h.

Function Documentation

◆ hashDjb2() [1/2]

template<>
uint32_t ace_common::hashDjb2 ( const __FlashStringHelper *  fs)
inline

Specialization of hashDjb2(T s) for flash strings (const __FlashStringHelper*).

Parameters
fsNUL terminated string stored in Flash memory, cannot be nullptr

Definition at line 70 of file djb2.h.

◆ hashDjb2() [2/2]

template<typename T >
uint32_t ace_common::hashDjb2 ( s)

Implement the djb2 hash algorithm as described in https://stackoverflow.com/questions/7666509 and http://www.cse.yorku.ca/~oz/hash.html.

Template Parameters
Tpointer type of the string, either (const char*) or (const __FlashStringHelper*)
Parameters
sNUL terminated string, cannot be nullptr

Definition at line 52 of file djb2.h.