uc-sdk
Main Page
Related Pages
Modules
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
hash-djb2.c
Go to the documentation of this file.
1
#include <stdint.h>
2
#include "
hash-djb2.h
"
3
#include "
osdebug.h
"
4
5
uint32_t
hash_djb2
(
const
uint8_t * str,
ssize_t
_max) {
6
uint32_t hash = 5381;
7
uint32_t max = (uint32_t) _max;
8
int
c;
9
10
while
(((c = *str++)) && max--) {
11
hash = ((hash << 5) + hash) ^ c;
12
}
13
14
return
hash;
15
}
os
src
hash-djb2.c
Generated on Fri Nov 15 2013 05:00:23 for uc-sdk by
1.8.4