/* This was taken from the gtk-devel mailing list. This hash will probly be put in * glib as the standard for next version. It's apparently almost 2x faster and has * better distribution than the native glib hash */ /* In message: From: Karl Nelson Subject: Re: g_str_hash Date: Fri, 11 Feb 2000 15:36:55 -0800 To: gtk-devel-list@redhat.com */ #include guint x31_hash (gconstpointer v) { const char *p; guint h=0; for (p = (const char*) v; *p != '\0'; p += 1) h = ( h << 5 ) - h + *p; return h; }