Rename utils to util

This commit is contained in:
2023-11-23 10:31:51 +01:00
parent 783db8ba90
commit adaada9a22
12 changed files with 6 additions and 6 deletions

View File

@@ -0,0 +1,20 @@
#ifndef BREEZE_STRING_H
#define BREEZE_STRING_H
#include "../defines.h"
typedef u32 (*BzStringHashFunc)(const char *str);
// djb2 hash algorithm
// From: https://stackoverflow.com/questions/7666509/hash-function-for-string
// http://www.cse.yorku.ca/~oz/hash.html
static u32 bzStringDefaultHash(const char *str) {
u32 hash = 5381;
int c;
while ((c = (int) *str++)) {
hash = ((hash << 5) + hash) + c; /* hash + 33 + c */
}
return hash;
}
#endif //BREEZE_STRING_H