亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? lookup3.c

?? 幾種c語言的hash算法
?? C
?? 第 1 頁 / 共 3 頁
字號:
     * rest of the string.  Every machine with memory protection I've seen     * does it on word boundaries, so is OK with this.  But VALGRIND will     * still catch it and complain.  The masking trick does make the hash     * noticably faster for short strings (like English words).     */#ifndef VALGRIND    switch(length)    {    case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;    case 11: c+=k[2]&0xffffff00; b+=k[1]; a+=k[0]; break;    case 10: c+=k[2]&0xffff0000; b+=k[1]; a+=k[0]; break;    case 9 : c+=k[2]&0xff000000; b+=k[1]; a+=k[0]; break;    case 8 : b+=k[1]; a+=k[0]; break;    case 7 : b+=k[1]&0xffffff00; a+=k[0]; break;    case 6 : b+=k[1]&0xffff0000; a+=k[0]; break;    case 5 : b+=k[1]&0xff000000; a+=k[0]; break;    case 4 : a+=k[0]; break;    case 3 : a+=k[0]&0xffffff00; break;    case 2 : a+=k[0]&0xffff0000; break;    case 1 : a+=k[0]&0xff000000; break;    case 0 : return c;              /* zero length strings require no mixing */    }#else  /* make valgrind happy */    k8 = (const uint8_t *)k;    switch(length)                   /* all the case statements fall through */    {    case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;    case 11: c+=((uint32_t)k8[10])<<8;  /* fall through */    case 10: c+=((uint32_t)k8[9])<<16;  /* fall through */    case 9 : c+=((uint32_t)k8[8])<<24;  /* fall through */    case 8 : b+=k[1]; a+=k[0]; break;    case 7 : b+=((uint32_t)k8[6])<<8;   /* fall through */    case 6 : b+=((uint32_t)k8[5])<<16;  /* fall through */    case 5 : b+=((uint32_t)k8[4])<<24;  /* fall through */    case 4 : a+=k[0]; break;    case 3 : a+=((uint32_t)k8[2])<<8;   /* fall through */    case 2 : a+=((uint32_t)k8[1])<<16;  /* fall through */    case 1 : a+=((uint32_t)k8[0])<<24; break;    case 0 : return c;    }#endif /* !VALGRIND */  } else {                        /* need to read the key one byte at a time */    const uint8_t *k = (const uint8_t *)key;    /*--------------- all but the last block: affect some 32 bits of (a,b,c) */    while (length > 12)    {      a += ((uint32_t)k[0])<<24;      a += ((uint32_t)k[1])<<16;      a += ((uint32_t)k[2])<<8;      a += ((uint32_t)k[3]);      b += ((uint32_t)k[4])<<24;      b += ((uint32_t)k[5])<<16;      b += ((uint32_t)k[6])<<8;      b += ((uint32_t)k[7]);      c += ((uint32_t)k[8])<<24;      c += ((uint32_t)k[9])<<16;      c += ((uint32_t)k[10])<<8;      c += ((uint32_t)k[11]);      mix(a,b,c);      length -= 12;      k += 12;    }    /*-------------------------------- last block: affect all 32 bits of (c) */    switch(length)                   /* all the case statements fall through */    {    case 12: c+=k[11];    case 11: c+=((uint32_t)k[10])<<8;    case 10: c+=((uint32_t)k[9])<<16;    case 9 : c+=((uint32_t)k[8])<<24;    case 8 : b+=k[7];    case 7 : b+=((uint32_t)k[6])<<8;    case 6 : b+=((uint32_t)k[5])<<16;    case 5 : b+=((uint32_t)k[4])<<24;    case 4 : a+=k[3];    case 3 : a+=((uint32_t)k[2])<<8;    case 2 : a+=((uint32_t)k[1])<<16;    case 1 : a+=((uint32_t)k[0])<<24;             break;    case 0 : return c;    }  }  final(a,b,c);  return c;}#ifdef SELF_TEST/* used for timings */void driver1(){  uint8_t buf[256];  uint32_t i;  uint32_t h=0;  time_t a,z;  time(&a);  for (i=0; i<256; ++i) buf[i] = 'x';  for (i=0; i<1; ++i)   {    h = hashlittle(&buf[0],1,h);  }  time(&z);  if (z-a > 0) printf("time %d %.8x\n", z-a, h);}/* check that every input bit changes every output bit half the time */#define HASHSTATE 1#define HASHLEN   1#define MAXPAIR 60#define MAXLEN  70void driver2(){  uint8_t qa[MAXLEN+1], qb[MAXLEN+2], *a = &qa[0], *b = &qb[1];  uint32_t c[HASHSTATE], d[HASHSTATE], i=0, j=0, k, l, m=0, z;  uint32_t e[HASHSTATE],f[HASHSTATE],g[HASHSTATE],h[HASHSTATE];  uint32_t x[HASHSTATE],y[HASHSTATE];  uint32_t hlen;  printf("No more than %d trials should ever be needed \n",MAXPAIR/2);  for (hlen=0; hlen < MAXLEN; ++hlen)  {    z=0;    for (i=0; i<hlen; ++i)  /*----------------------- for each input byte, */    {      for (j=0; j<8; ++j)   /*------------------------ for each input bit, */      {	for (m=1; m<8; ++m) /*------------ for serveral possible initvals, */	{	  for (l=0; l<HASHSTATE; ++l)	    e[l]=f[l]=g[l]=h[l]=x[l]=y[l]=~((uint32_t)0);      	  /*---- check that every output bit is affected by that input bit */	  for (k=0; k<MAXPAIR; k+=2)	  { 	    uint32_t finished=1;	    /* keys have one bit different */	    for (l=0; l<hlen+1; ++l) {a[l] = b[l] = (uint8_t)0;}	    /* have a and b be two keys differing in only one bit */	    a[i] ^= (k<<j);	    a[i] ^= (k>>(8-j));	     c[0] = hashlittle(a, hlen, m);	    b[i] ^= ((k+1)<<j);	    b[i] ^= ((k+1)>>(8-j));	     d[0] = hashlittle(b, hlen, m);	    /* check every bit is 1, 0, set, and not set at least once */	    for (l=0; l<HASHSTATE; ++l)	    {	      e[l] &= (c[l]^d[l]);	      f[l] &= ~(c[l]^d[l]);	      g[l] &= c[l];	      h[l] &= ~c[l];	      x[l] &= d[l];	      y[l] &= ~d[l];	      if (e[l]|f[l]|g[l]|h[l]|x[l]|y[l]) finished=0;	    }	    if (finished) break;	  }	  if (k>z) z=k;	  if (k==MAXPAIR) 	  {	     printf("Some bit didn't change: ");	     printf("%.8x %.8x %.8x %.8x %.8x %.8x  ",	            e[0],f[0],g[0],h[0],x[0],y[0]);	     printf("i %d j %d m %d len %d\n", i, j, m, hlen);	  }	  if (z==MAXPAIR) goto done;	}      }    }   done:    if (z < MAXPAIR)    {      printf("Mix success  %2d bytes  %2d initvals  ",i,m);      printf("required  %d  trials\n", z/2);    }  }  printf("\n");}/* Check for reading beyond the end of the buffer and alignment problems */void driver3(){  uint8_t buf[MAXLEN+20], *b;  uint32_t len;  uint8_t q[] = "This is the time for all good men to come to the aid of their country...";  uint32_t h;  uint8_t qq[] = "xThis is the time for all good men to come to the aid of their country...";  uint32_t i;  uint8_t qqq[] = "xxThis is the time for all good men to come to the aid of their country...";  uint32_t j;  uint8_t qqqq[] = "xxxThis is the time for all good men to come to the aid of their country...";  uint32_t ref,x,y;  uint8_t *p;  printf("sizeof(q)=%d\n",sizeof(q));  printf("Endianness.  These lines should all be the same (for values filled in):\n");  printf("%.8x                            %.8x                            %.8x\n",         hashword((const uint32_t *)q, (sizeof(q)-1)/4, 13),         hashword((const uint32_t *)q, (sizeof(q)-5)/4, 13),         hashword((const uint32_t *)q, (sizeof(q)-9)/4, 13));  p = q;  printf("%.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x\n",         hashlittle(p, sizeof(q)-1, 13), hashlittle(p, sizeof(q)-2, 13),         hashlittle(p, sizeof(q)-3, 13), hashlittle(p, sizeof(q)-4, 13),         hashlittle(p, sizeof(q)-5, 13), hashlittle(p, sizeof(q)-6, 13),         hashlittle(p, sizeof(q)-7, 13), hashlittle(p, sizeof(q)-8, 13),         hashlittle(p, sizeof(q)-9, 13), hashlittle(p, sizeof(q)-10, 13),         hashlittle(p, sizeof(q)-11, 13), hashlittle(p, sizeof(q)-12, 13));  p = &qq[1];  printf("%.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x\n",         hashlittle(p, sizeof(q)-1, 13), hashlittle(p, sizeof(q)-2, 13),         hashlittle(p, sizeof(q)-3, 13), hashlittle(p, sizeof(q)-4, 13),         hashlittle(p, sizeof(q)-5, 13), hashlittle(p, sizeof(q)-6, 13),         hashlittle(p, sizeof(q)-7, 13), hashlittle(p, sizeof(q)-8, 13),         hashlittle(p, sizeof(q)-9, 13), hashlittle(p, sizeof(q)-10, 13),         hashlittle(p, sizeof(q)-11, 13), hashlittle(p, sizeof(q)-12, 13));  p = &qqq[2];  printf("%.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x\n",         hashlittle(p, sizeof(q)-1, 13), hashlittle(p, sizeof(q)-2, 13),         hashlittle(p, sizeof(q)-3, 13), hashlittle(p, sizeof(q)-4, 13),         hashlittle(p, sizeof(q)-5, 13), hashlittle(p, sizeof(q)-6, 13),         hashlittle(p, sizeof(q)-7, 13), hashlittle(p, sizeof(q)-8, 13),         hashlittle(p, sizeof(q)-9, 13), hashlittle(p, sizeof(q)-10, 13),         hashlittle(p, sizeof(q)-11, 13), hashlittle(p, sizeof(q)-12, 13));  p = &qqqq[3];  printf("%.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x\n",         hashlittle(p, sizeof(q)-1, 13), hashlittle(p, sizeof(q)-2, 13),         hashlittle(p, sizeof(q)-3, 13), hashlittle(p, sizeof(q)-4, 13),         hashlittle(p, sizeof(q)-5, 13), hashlittle(p, sizeof(q)-6, 13),         hashlittle(p, sizeof(q)-7, 13), hashlittle(p, sizeof(q)-8, 13),         hashlittle(p, sizeof(q)-9, 13), hashlittle(p, sizeof(q)-10, 13),         hashlittle(p, sizeof(q)-11, 13), hashlittle(p, sizeof(q)-12, 13));  printf("\n");  /* check that hashlittle2 and hashlittle produce the same results */  i=47; j=0;  hashlittle2(q, sizeof(q), &i, &j);  if (hashlittle(q, sizeof(q), 47) != i)    printf("hashlittle2 and hashlittle mismatch\n");  /* check that hashword2 and hashword produce the same results */  len = 0xdeadbeef;  i=47, j=0;  hashword2(&len, 1, &i, &j);  if (hashword(&len, 1, 47) != i)    printf("hashword2 and hashword mismatch %x %x\n", 	   i, hashword(&len, 1, 47));  /* check hashlittle doesn't read before or after the ends of the string */  for (h=0, b=buf+1; h<8; ++h, ++b)  {    for (i=0; i<MAXLEN; ++i)    {      len = i;      for (j=0; j<i; ++j) *(b+j)=0;      /* these should all be equal */      ref = hashlittle(b, len, (uint32_t)1);      *(b+i)=(uint8_t)~0;      *(b-1)=(uint8_t)~0;      x = hashlittle(b, len, (uint32_t)1);      y = hashlittle(b, len, (uint32_t)1);      if ((ref != x) || (ref != y))       {	printf("alignment error: %.8x %.8x %.8x %d %d\n",ref,x,y,               h, i);      }    }  }}/* check for problems with nulls */ void driver4(){  uint8_t buf[1];  uint32_t h,i,state[HASHSTATE];  buf[0] = ~0;  for (i=0; i<HASHSTATE; ++i) state[i] = 1;  printf("These should all be different\n");  for (i=0, h=0; i<8; ++i)  {    h = hashlittle(buf, 0, h);    printf("%2ld  0-byte strings, hash is  %.8x\n", i, h);  }}#if 0int main(){  driver1();   /* test that the key is hashed: used for timings */  driver2();   /* test that whole key is hashed thoroughly */  driver3();   /* test that nothing but the key is hashed */  driver4();   /* test hashing multiple buffers (all buffers are null) */  return 1;}#elsestruct timeval tpstart,tpend;float  timeuse;int main(int argc, char** argv){	unsigned long hash;	int i;		unsigned char buf1[]={0x00,0x00,0x00,0x00,0x00,0x29,0xc2,0xaa};	for (i = 0; i < 200; i++)	{	//gettimeofday(&tpstart,NULL);	hash = hashlittle(buf1, sizeof(buf1), 13);	//gettimeofday(&tpend,NULL); 	//timeuse=1000000*(tpend.tv_sec-tpstart.tv_sec)+ 	//tpend.tv_usec-tpstart.tv_usec;  	//timeuse/=1000000;  	//printf("------Used Time:%fs-----hash=bx--------\n", timeuse, hash);  	printf("--------%d------\n", hash&0x1ffff); 	buf1[7]++;	}}#endif#endif  /* SELF_TEST */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
午夜欧美视频在线观看| 亚洲色图制服诱惑| 国产在线日韩欧美| 久久人人爽人人爽| 成人小视频在线观看| 亚洲精品欧美激情| 欧美理论片在线| 精品亚洲欧美一区| 国产精品每日更新| 欧美性大战久久久久久久| 日本一道高清亚洲日美韩| 欧美精品一区二区三区高清aⅴ | 久久色.com| 成人精品高清在线| 亚洲国产精品人人做人人爽| 777久久久精品| 国产盗摄一区二区三区| 亚洲天堂福利av| 日韩限制级电影在线观看| 国产剧情一区在线| 亚洲伦理在线精品| 欧美sm美女调教| 91浏览器打开| 久久精品国产999大香线蕉| 国产精品入口麻豆九色| 在线亚洲高清视频| 国产综合久久久久久鬼色 | 亚洲手机成人高清视频| 欧美日韩国产精品成人| 大胆亚洲人体视频| 日韩精品一级中文字幕精品视频免费观看 | 国产精品亚洲一区二区三区妖精| 精品粉嫩aⅴ一区二区三区四区| 国产91富婆露脸刺激对白| 一区二区三区在线视频观看| 欧美不卡一区二区三区| 色婷婷久久99综合精品jk白丝| 免费成人在线网站| 亚洲综合一区二区精品导航| 久久久精品2019中文字幕之3| 欧美性大战久久久久久久 | 国产精品国产三级国产| 91精品在线麻豆| 99r国产精品| 国产精品亚洲成人| 麻豆成人91精品二区三区| 一区二区三区丝袜| 中文字幕av不卡| 亚洲精品一区在线观看| 91精品国产综合久久福利| 波多野洁衣一区| 国产在线视频精品一区| 青草av.久久免费一区| 亚洲一区成人在线| 亚洲人成精品久久久久| 欧美激情在线观看视频免费| 精品久久久久99| 日韩三级.com| 欧美另类变人与禽xxxxx| 色综合久久66| 成人精品国产免费网站| 粉嫩av亚洲一区二区图片| 国产一区美女在线| 久久疯狂做爰流白浆xx| 秋霞午夜av一区二区三区| 亚洲一区二区三区四区五区黄| 成人免费在线视频观看| 国产无一区二区| 国产欧美日韩在线视频| 久久久久国色av免费看影院| 欧美不卡一区二区三区| 日韩欧美国产精品一区| 日韩视频永久免费| 日韩视频中午一区| 欧美成人高清电影在线| 欧美成人一区二区三区在线观看| 日韩美一区二区三区| 日韩美女视频在线| 久久网站热最新地址| 久久婷婷国产综合国色天香| 久久中文字幕电影| 亚洲国产精品v| 亚洲同性同志一二三专区| 亚洲三级小视频| 亚洲精选一二三| 一区二区三区在线播| 亚洲第一会所有码转帖| 日韩av一区二区三区| 麻豆一区二区三区| 国内精品免费**视频| 成人听书哪个软件好| 99久久99久久免费精品蜜臀| 欧美性猛片aaaaaaa做受| 欧美久久久久久久久久| 国产精品入口麻豆原神| 亚洲综合自拍偷拍| 偷拍与自拍一区| 久草中文综合在线| 99re视频精品| 欧美精品视频www在线观看 | 久久久精品影视| 国产精品美女一区二区三区| 一区二区三区在线视频观看| 日本亚洲视频在线| 国产一区在线视频| 91在线播放网址| 538在线一区二区精品国产| 精品福利一二区| 亚洲人快播电影网| 男人的天堂亚洲一区| 成人动漫一区二区三区| 在线亚洲精品福利网址导航| 精品久久久久久久人人人人传媒| 亚洲欧美怡红院| 免费av成人在线| 99亚偷拍自图区亚洲| 91精品国产综合久久久久久| 国产午夜亚洲精品午夜鲁丝片 | 欧美福利视频一区| 国产人久久人人人人爽| 日韩精品国产欧美| 99精品国产99久久久久久白柏| 欧美一区二区在线免费播放| ...xxx性欧美| 国产一区二区三区免费播放| 欧美日韩久久久久久| 欧美激情在线观看视频免费| 日本91福利区| 色悠悠久久综合| 久久九九影视网| 天天色天天操综合| 99国产精品久久久久| 欧美va在线播放| 天堂久久久久va久久久久| 91网站最新地址| 欧美国产一区二区| 久久精品久久精品| 欧美日韩久久久一区| 亚洲免费色视频| 成人性生交大片免费| 久久久久一区二区三区四区| 日本亚洲一区二区| 欧美日韩在线直播| 亚洲激情综合网| 91一区二区三区在线观看| 久久精品一区二区三区不卡| 老司机精品视频在线| 欧美日韩一级黄| 亚洲午夜精品17c| 色婷婷av一区二区三区大白胸 | 日本韩国视频一区二区| 国产精品精品国产色婷婷| 国产高清不卡一区| 久久精品在这里| 国产麻豆精品久久一二三| 精品国产sm最大网站免费看| 日韩成人伦理电影在线观看| 51精品秘密在线观看| 日韩av一级片| 日韩欧美激情一区| 开心九九激情九九欧美日韩精美视频电影| 欧美日本不卡视频| 日韩黄色一级片| 国产精品视频免费| 国产精品一区二区黑丝| 国产嫩草影院久久久久| 成人激情文学综合网| 中文字幕一区二| 色偷偷88欧美精品久久久| 亚洲精品视频在线| 欧美三级电影精品| 天堂蜜桃91精品| 精品国产一区a| 国产成人午夜精品影院观看视频 | 国产精品伦理在线| www.激情成人| 亚洲一区二区精品视频| 欧美高清精品3d| 久久99国产精品久久99果冻传媒| 精品国产乱码久久| www.av亚洲| 亚洲国产精品久久不卡毛片| 91精品免费在线观看| 狠狠狠色丁香婷婷综合久久五月| 久久精品在这里| 色婷婷av久久久久久久| 婷婷国产在线综合| 久久综合成人精品亚洲另类欧美 | 中文字幕成人av| 日本福利一区二区| 蜜臀精品久久久久久蜜臀| 国产亚洲精品aa午夜观看| 91片在线免费观看| 日本最新不卡在线| 国产视频一区二区在线| 色综合久久久久综合体桃花网| 午夜久久福利影院| 国产欧美精品国产国产专区| 在线免费一区三区| 国内精品视频666|