Re: Proposed patch: Modify glib to permit embedded NULs in GString.



-> guint
-> g_string_hash (const GString *str)
-> {
->   const gchar *p = str->str;
->   gint n = str->len;
->   guint h = 0;
-> 
->   while (n--)
->     {
->       h = (h << 5) - h + *p;
->       p++;
->     }
-> 
->   return h;
-> }

     Owen,
	Where did you get this hashing algorithm?  (I noticed it's the
same one as in g_str_hash() ).

	I have a couple of books that cover hash algorithms and neither of
them has this in it...


Thanks,
Derek





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]