nss-pam-ldapd branch master updated. 0.9.1-26-g0697347
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
nss-pam-ldapd branch master updated. 0.9.1-26-g0697347
- From: Commits of the nss-pam-ldapd project <nss-pam-ldapd-commits [at] lists.arthurdejong.org>
- To: nss-pam-ldapd-commits [at] lists.arthurdejong.org
- Reply-to: nss-pam-ldapd-users [at] lists.arthurdejong.org
- Subject: nss-pam-ldapd branch master updated. 0.9.1-26-g0697347
- Date: Mon, 14 Oct 2013 22:26:07 +0200 (CEST)
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "nss-pam-ldapd".
The branch, master has been updated
via 06973479a97d3c99f7a3ce284cb8974bacb6fd3f (commit)
from 61e96bf393f0e3f39125f9e1a5f73cfefdf719df (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://arthurdejong.org/git/nss-pam-ldapd/commit/?id=06973479a97d3c99f7a3ce284cb8974bacb6fd3f
commit 06973479a97d3c99f7a3ce284cb8974bacb6fd3f
Author: Arthur de Jong <arthur@arthurdejong.org>
Date: Mon Oct 14 22:25:08 2013 +0200
Use djb2 hash in dict module
This slightly modifies the string hashing function to use the djb2 hash.
This hash is supposed to be reasonably fast and have reasonably few
collisions.
diff --git a/common/dict.c b/common/dict.c
index 03e9a7b..d4cfd8e 100644
--- a/common/dict.c
+++ b/common/dict.c
@@ -2,7 +2,7 @@
dict.c - dictionary functions
This file is part of the nss-pam-ldapd library.
- Copyright (C) 2007, 2008, 2009, 2010, 2012 Arthur de Jong
+ Copyright (C) 2007, 2008, 2009, 2010, 2012, 2013 Arthur de Jong
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -72,9 +72,10 @@ struct dictionary {
/* Simple hash function that computes the hash value of a string. */
static uint32_t stringhash(const char *str)
{
- uint32_t hash = 0;
- while (*str != '\0')
- hash = 3 * hash + *str++;
+ uint32_t hash = 5381;
+ uint32_t c;
+ while ((c = *str++) != '\0')
+ hash = 33 * hash + c;
return hash;
}
-----------------------------------------------------------------------
Summary of changes:
common/dict.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
hooks/post-receive
--
nss-pam-ldapd
--
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits/
- nss-pam-ldapd branch master updated. 0.9.1-26-g0697347,
Commits of the nss-pam-ldapd project