Re: Proposed patch: Modify glib to permit embedded NULs in GString.
- From: Owen Taylor <otaylor redhat com>
- To: Derek Simkowiak <dereks kd-dev com>
- Cc: gtk-devel-list redhat com
- Subject: Re: Proposed patch: Modify glib to permit embedded NULs in GString.
- Date: 29 Jun 2000 16:44:12 -0400
Derek Simkowiak <dereks@kd-dev.com> writes:
> -> 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...
See the long thread titled g_str_hash().
http://mail.gnome.org/pipermail/gtk-devel-list/2000-February/thread.html
Regards,
Owen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]