about summary refs log tree commit diff
path: root/src/base/system.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/base/system.c')
-rw-r--r--src/base/system.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/base/system.c b/src/base/system.c
index be2a5d5a..f570fdf3 100644
--- a/src/base/system.c
+++ b/src/base/system.c
@@ -1354,6 +1354,16 @@ int str_utf8_decode(const char **ptr)
 	
 }
 
+
+unsigned str_quickhash(const char *str)
+{
+	unsigned hash = 5381;
+	for(; *str; str++)
+		hash = ((hash << 5) + hash) + (*str); /* hash * 33 + c */
+	return hash;
+}
+
+
 #if defined(__cplusplus)
 }
 #endif