]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/hash.c
Move SSL-related configuration variables to new [SSL] section
[ngircd-alex.git] / src / ngircd / hash.c
index 9bf4240903c63e56780e12e1069e767e9386942d..113133d20c7f75019b35297aba13904cf32e4c79 100644 (file)
@@ -9,7 +9,6 @@
  * Please read the file COPYING, README and AUTHORS for more information.
  */
 
-
 #include "portab.h"
 
 /**
 #include "exp.h"
 #include "hash.h"
 
+static UINT32 jenkins_hash PARAMS((register UINT8 *k, register UINT32 length,
+                                  register UINT32 initval));
 
-static UINT32 jenkins_hash PARAMS(( register UINT8 *k, register UINT32 length, register UINT32 initval ));
-
-
+/**
+ * Calculate hash value for a given string.
+ *
+ * @param String Input string
+ * @return 32 bit hash value
+ */
 GLOBAL UINT32
 Hash( const char *String )
 {
-       /* Hash-Wert ueber String berechnen */
-
        char buffer[LINE_LEN];
 
        strlcpy(buffer, String, sizeof(buffer));
@@ -43,20 +45,18 @@ Hash( const char *String )
                            (UINT32)strlen(buffer), 42);
 } /* Hash */
 
-
 /*
- * Die hier verwendete Hash-Funktion stammt aus lookup2.c von Bob Jenkins
- * (URL: <http://burtleburtle.net/bob/c/lookup2.c>). Aus dem Header:
+ * This hash function originates from lookup2.c of Bob Jenkins
+ * (URL: <http://burtleburtle.net/bob/c/lookup2.c>):
  * --------------------------------------------------------------------
  * lookup2.c, by Bob Jenkins, December 1996, Public Domain.
  * hash(), hash2(), hash3, and mix() are externally useful functions.
  * Routines to test the hash are included if SELF_TEST is defined.
  * You can use this free for any purpose.  It has no warranty.
  * --------------------------------------------------------------------
- * nicht alle seiner Funktionen werden hier genutzt.
+ * Not all of his functions are used here.
  */
 
-
 #define hashsize(n) ((UINT32)1<<(n))
 #define hashmask(n) (hashsize(n)-1)
 
@@ -73,7 +73,6 @@ Hash( const char *String )
        c -= a; c -= b; c ^= (b>>15); \
 } /* mix */
 
-
 static UINT32
 jenkins_hash( register UINT8 *k, register UINT32 length, register UINT32 initval )
 {
@@ -123,5 +122,4 @@ jenkins_hash( register UINT8 *k, register UINT32 length, register UINT32 initval
        return c;
 } /* jenkins_hash */
 
-
 /* -eof- */