[mod-xhtml-neg-cvs] mod_xhtml_neg mod_xhtml_neg.c,1.15,1.16
Brought to you by:
run2000
From: <ru...@us...> - 2004-03-12 10:18:44
|
Update of /cvsroot/mod-xhtml-neg/mod_xhtml_neg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4611 Modified Files: mod_xhtml_neg.c Log Message: More comments added about the hashcode algorithm. Index: mod_xhtml_neg.c =================================================================== RCS file: /cvsroot/mod-xhtml-neg/mod_xhtml_neg/mod_xhtml_neg.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** mod_xhtml_neg.c 12 Mar 2004 09:48:31 -0000 1.15 --- mod_xhtml_neg.c 12 Mar 2004 09:51:22 -0000 1.16 *************** *** 497,500 **** --- 497,503 ---- * and a simple hash of each character. These are then represented as * two hyphen separated hexadecimal numbers. + * + * The data that we generate the hash from is the content-type, charset, + * and profile, concatenated as one long string. */ *************** *** 509,512 **** --- 512,518 ---- hash = 7; + /* Note that we use a multiplier of 128 rather than 256 since HTTP + * headers are only guaranteed 7-bit US-ASCII safe. + */ for( i = 0; i < len; i++ ) { hash = hash * 128 + data[ i ]; |