Re: Proposed patch: Modify glib to permit embedded NULs in GString.
- From: Derek Simkowiak <dereks kd-dev com>
- To: Owen Taylor <otaylor redhat com>
- Cc: gtk-devel-list redhat com
- Subject: Re: Proposed patch: Modify glib to permit embedded NULs in GString.
- Date: Thu, 29 Jun 2000 13:20:12 -0700 (PDT)
-> 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]