-XBT_INLINE XBT_PUBLIC(unsigned int) xbt_dict_hash_ext(const char *str,
- int str_len);
-XBT_INLINE XBT_PUBLIC(unsigned int) xbt_dict_hash(const char *str);
-
-/** @brief Classical alias to (char*)
- *
- * This of almost no use, beside cosmetics and the XBT datadesc parsing macro (see \ref XBT_dd_auto).
+ while (bp < be) {
+ /* multiply by the 32 bit FNV magic prime mod 2^32 */
+ hash +=
+ (hash << 1) + (hash << 4) + (hash << 7) + (hash << 8) +
+ (hash << 24);
+
+ /* xor the bottom with the current octet */
+ hash ^= (unsigned int) *bp++;
+ }
+
+# else
+ unsigned int hash = 0;
+
+ while (str_len--) {
+ hash += (*str) * (*str);
+ str++;
+ }
+#endif
+
+ return hash;
+}
+
+/**
+ * @brief Returns the hash code of a string.