Index: uspace/lib/c/include/adt/hash.h
===================================================================
--- uspace/lib/c/include/adt/hash.h	(revision a949f4ae07227222cc7ff520baf64ebe6ef3d307)
+++ uspace/lib/c/include/adt/hash.h	(revision bb154c64b6e4b7d6a2a8e19760b6ae60156847b4)
@@ -111,3 +111,23 @@
 }
 
+/** Calculate hash of NULL-terminated string
+ *
+ * TODO Modify also same file in kernel subtree?
+ *
+ * @param[in]  str     NULL-terminated string (not NULL)
+ */
+static inline size_t hash_string(const char *str)
+{
+	/*
+	 * Using djb2 function
+	 * http://www.cse.yorku.ca/~oz/hash.html
+	 */
+	size_t hash = 5381;
+	char c;
+	while ((c = *str++)) {
+		hash = ((hash << 5) + hash) + c; /* hash * 33 + c */
+	}
+	return hash;
+}
+
 #endif
