12 2010 档案

摘要:#includestdio.h #includestring.h #include stdlib.h #include stdint.h uint32_t additive_hash(char *key, uint32_t len, uint32_t prime) { uint32_t hash, i; for (hash=len, i=0; ilen; ++i) hash += key[i]; return (hash % prime); } int main(int argc, char **argv) { char name[1024]; int init =0; if 阅读全文
posted @ 2010-12-24 18:07 napoleon_liu 阅读(471) 评论(0) 推荐(0)
摘要:php, apache, perl, bsddb都使用time33哈希. 最简单的版本     uint32_t time33(char const *str, int len)     {         unsigned long  hash = 0;         for (int i = 0; i len; i++) {             hash = hash *33 + ... 阅读全文
posted @ 2010-12-20 16:35 napoleon_liu 阅读(6621) 评论(0) 推荐(2)
摘要:HTTP是一个属于应用层的面向对象的协议,由于其简捷、快速的方式,适用于分布式超媒体信息系统。它于1990年提出,经过几年的使用与发展,得到不断地完善和扩展。目前在WWW中使用的是HTTP/1.0的第六版,HTTP/1.1的规范化工作正在进行之中,而且HTTP-NG(Next Generation of HTTP)的建议已经提出。 HTTP协议的主要特点可概括如下: 1.支持客户/服务器模式。 2... 阅读全文
posted @ 2010-12-16 15:25 napoleon_liu 阅读(440) 评论(0) 推荐(0)