hash function for reference;

master
Alexander Vdolainen 4 years ago
parent 573e0a9eaa
commit 3c9528bb0a

@ -20,7 +20,21 @@
#include <stdio.h> #include <stdio.h>
#include <eport.h>
unsigned long djb_hash(const char *s)
{
unsigned long hash = 5381;
int c;
while((c = *s++))
hash = ((hash << 5) + hash) + c;
return hash;
}
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
return 0; return 0;
} }

Loading…
Cancel
Save