数据来源 :http://www.backplane.com/matt/crc64.html
博客字数限制,发不了全部的,就摘抄部分,原档的要看上面的连接。
SAMPLES CRC16 CRC17 CRC18 CRC19 CRC20 CRC21 CRC22 0.1M 48694 29762 17032 9070 4519 2274 1212 0.2M 137655 97436 60243 34119 17834 9211 4809 0.3M 235174 182198 121457 71883 39173 20303 10626 0.4M 334630 275232 194897 120208 67433 35624 18672 0.5M 434497 371788 277068 177992 102379 55094 28973 0.6M 534472 470260 364505 242833 143019 78184 41394 0.7M 634464 569530 456066 314036 189198 105006 55646 0.8M 734464 669213 550297 389973 240256 135019 72156 0.9M 834464 769050 646412 470339 295794 168415 91007 1.0M 934464 868987 743717 554420 356011 205050 111280 1.1M 1034464 968955 841834 640870 419364 244383 133311 1.2M 1134464 1068940 940621 729741 486134 286809 157443 1.3M 1234464 1168934 1039769 820321 555780 331720 183461 1.4M 1334464 1268929 1139183 912533 628092 379218 210872 1.5M 1434464 1368928 1238758 1006000 702876 429273 239867 1.6M 1534464 1468928 1338453 1100821 779956 481688 270883 1.7M 1634464 1568928 1438273 1196438 859240 536198 303568 1.8M 1734464 1668928 1538141 1292873 940251 592525 337916 1.9M 1834464 1768928 1638059 1389909 1023041 651033 373656 2.0M 1934464 1868928 1737994 1487422 1107333 711244 410826 2.1M 2034464 1968928 1837950 1585341 1193293 773717 449497 2.2M 2134464 2068928 1937912 1683661 1280182 837874 489659 2.3M 2234464 2168928 2037896 1782338 1368569 903329 531092 2.4M 2334464 2268928 2137886 1881219 1457974 970943 574008 2.5M 2434464 2368928 2237876 1980254 1548323 1040150 618300 2.6M 2534464 2468928 2337871 2079431 1639565 1110486 663715 2.7M 2634464 2568928 2437865 2178796 1731494 1182295 710659 2.8M 2734464 2668928 2537864 2278265 1824318 1255416 758787 2.9M 2834464 2768928 2637862 2377821 1917637 1329614 808881 3.0M 2934464 2868928 2737860 2477444 2011671 1404983 859560 3.1M 3034464 2968928 2837860 2577106 2106181 1481548 911427 3.2M 3134464 3068928 2937858 2676871 2201256 1559161 964548 3.3M 3234464 3168928 3037857 2776663 2296730 1637708 1018633 3.4M 3334464 3268928 3137857 2876501 2392603 1717381 1073688 3.5M 3434464 3368928 3237856 2976378 2488787 1797956 1129971 3.6M 3534464 3468928 3337856 3076253 2585461 1879781 1187477 3.7M 3634464 3568928 3437856 3176153 2682289 1962055 1245443 3.8M 3734464 3668928 3537856 3276069 2779522 2045323 1304322 3.9M 3834464 3768928 3637856 3375998 2876899 2129150 1364051 4.0M 3934464 3868928 3737856 3475954 2974533 2213928 1425122 4.1M 4034464 3968928 3837856 3575923 3072335 2299534 1486908 4.2M 4134464 4068928 3937856 3675886 3170396 2385735 1549452 4.3M 4234464 4168928 4037856 3775858 3268655 2472571 1613325 4.4M 4334464 4268928 4137856 3875842 3367088 2559869 1677674 4.5M 4434464 4368928 4237856 3975821 3465615 2648049 1742853 4.6M 4534464 4468928 4337856 4075795 3564349 2736602 1809114 4.7M 4634464 4568928 4437856 4175777 3663217 2825783 1876105 4.8M 4734464 4668928 4537856 4275764 3762136 2915383 1943892 4.9M 4834464 4768928 4637856 4375759 3861176 3005392 2012783 5.0M 4934464 4868928 4737856 4475750 3960320 3095984 2081668 5.1M 5034464 4968928 4837856 4575741 4059520 3187080 2151865 5.2M 5134464 5068928 4937856 4675736 4158805 3278589 2222601 5.3M 5234464 5168928 5037856 4775732 4258124 3370362 2294052 5.4M 5334464 5268928 5137856 4875729 4357467 3462417 2366046 5.5M 5434464 5368928 5237856 4975724 4456955 3555133 2439316 5.6M 5534464 5468928 5337856 5075718 4556432 3647988 2512981 5.7M 5634464 5568928 5437856 5175717 4655960 3741135 2586722 5.8M 5734464 5668928 5537856 5275716 4755527 3834632 2661206 5.9M 5834464 5768928 5637856 5375716 4855124 3928457 2736335 6.0M 5934464 5868928 5737856 5475716 4954791 4022609 2812198 6.1M 6034464 5968928 5837856 5575716 5054480 4116952 2888493 6.2M 6134464 6068928 5937856 5675715 5154207 4211638 2965405 6.3M 6234464 6168928 6037856 5775713 5253974 4306725 3042750 6.4M 6334464 6268928 6137856 5875713 5353726 4401850 3120827 6.5M 6434464 6368928 6237856 5975713 5453499 4497092 3199416 6.6M 6534464 6468928 6337856 6075713 5553283 4592770 3278557 6.7M 6634464 6568928 6437856 6175712 5653122 4688523 3357916 6.8M 6734464 6668928 6537856 6275712 5752959 4784520 3437768 6.9M 6834464 6768928 6637856 6375712 5852821 4880693 3518173 7.0M 6934464 6868928 6737856 6475712 5952687 4977178 3599520 7.1M 7034464 6968928 6837856 6575712 6052594 5073701 3680754 7.2M 7134464 7068928 6937856 6675712 6152491 5170430 3762707 7.3M 7234464 7168928 7037856 6775712 6252398 5267324 3844797 7.4M 7334464 7268928 7137856 6875712 6352304 5364342 3927360 7.5M 7434464 7368928 7237856 6975712 6452219 5461484 4010446 7.6M 7534464 7468928 7337856 7075712 6552148 5558762 4093846 7.7M 7634464 7568928 7437856 7175712 6652078 5656120 4177539 7.8M 7734464 7668928 7537856 7275712 6752016 5753645 4261754 7.9M 7834464 7768928 7637856 7375712 6851972 5851322 4346179 8.0M 7934464 7868928 7737856 7475712 6951923 5949090 4431051 8.1M 8034464 7968928 7837856 7575712 7051873 6047013 4516301 8.2M 8134464 8068928 7937856 7675712 7151834 6145045 4602179 8.3M 8234464 8168928 8037856 7775712 7251795 6243049 4688051 8.4M 8334464 8268928 8137856 7875712 7351768 6341112 4774326 8.5M 8434464 8368928 8237856 7975712 7451730 6439315 4860966 8.6M 8534464 8468928 8337856 8075712 7551700 6537656 4947710 8.7M 8634464 8568928 8437856 8175712 7651675 6636098 5035000 8.8M 8734464 8668928 8537856 8275712 7751661 6734537 5122377 8.9M 8834464 8768928 8637856 8375712 7851639 6833018 5210463 9.0M 8934464 8868928 8737856 8475712 7951624 6931591 5298611 9.1M 9034464 8968928 8837856 8575712 8051609 7030228 5387026 9.2M 9134464 9068928 8937856 8675712 8151591 7128959 5475625 9.3M 9234464 9168928 9037856 8775712 8251571 7227687 5564631 9.4M 9334464 9268928 9137856 8875712 8351554 7326511 5653851 9.5M 9434464 9368928 9237856 8975712 8451536 7425413 5743199 9.6M 9534464 9468928 9337856 9075712 8551525 7524363 5832806 9.7M 9634464 9568928 9437856 9175712 8651512 7623334 5922809 9.8M 9734464 9668928 9537856 9275712 8751506 7722378 6012870 9.9M 9834464 9768928 9637856 9375712 8851498 7821467 6103347 10.0M 9934464 9868928 9737856 9475712 8951490 7920572 6193916 10.1M 10034464 9968928 9837856 9575712 9051482 8019780 6284966 10.2M 10134464 10068928 9937856 9675712 9151477 8118999 6376112 10.3M 10234464 10168928 10037856 9775712 9251476 8218282 6467503 10.4M 10334464 10268928 10137856 9875712 9351467 8317547 6558992 10.5M 10434464 10368928 10237856 9975712 9451464 8416839 6650539 10.6M 10534464 10468928 10337856 10075712 9551457 8516198 6742411 10.7M 10634464 10568928 10437856 10175712 9651456 8615549 6834358 10.8M 10734464 10668928 10537856 10275712 9751453 8714980 6926671 10.9M 10834464 10768928 10637856 10375712 9851450 8814399 7019247 11.0M 10934464 10868928 10737856 10475712 9951450 8913863 7111788 11.1M 11034464 10968928 10837856 10575712 10051446 9013352 7204576 11.2M 11134464 11068928 10937856 10675712 10151441 9112830 7297627 11.3M 11234464 11168928 11037856 10775712 10251439 9212377 7390677 11.4M 11334464 11268928 11137856 10875712 10351438 9311932 7484095 11.5M 11434464 11368928 11237856 10975712 10451438 9411486 7577501 11.6M 11534464 11468928 11337856 11075712 10551437 9511091 7671099 11.7M 11634464 11568928 11437856 11175712 10651437 9610721 7764779 11.8M 11734464 11668928 11537856 11275712 10751437 9710338 7858777 11.9M 11834464 11768928 11637856 11375712 10851437 9809986 7952825 12.0M 11934464 11868928 11737856 11475712 10951437 9909670 8046961 12.1M 12034464 11968928 11837856 11575712 11051435 10009330 8141240 12.2M 12134464 12068928 11937856 11675712 11151435 10109004 8235736 12.3M 12234464 12168928 12037856 11775712 11251434 10208737 8330319 12.4M 12334464 12268928 12137856 11875712 11351433 10308453 8425059 12.5M 12434464 12368928 12237856 11975712 11451433 10408196 8519955 12.6M 12534464 12468928 12337856 12075712 11551432 10507935 8614938 12.7M 12634464 12568928 12437856 12175712 11651432 10607685 8709879 12.8M 12734464 12668928 12537856 12275712 11751430 10707493 8804977 12.9M 12834464 12768928 12637856 12375712 11851429 10807250 8900269 13.0M 12934464 12868928 12737856 12475712 11951427 10907058 8995654 13.1M 13034464 12968928 12837856 12575712 12051427 11006869 9091102 13.2M 13134464 13068928 12937856 12675712 12151427 11106665 9186622 13.3M 13234464 13168928 13037856 12775712 12251426 11206488 9282381 13.4M 13334464 13268928 13137856 12875712 12351426 11306298 9378266 13.5M 13434464 13368928 13237856 12975712 12451426 11406124 9474206 13.6M 13534464 13468928 13337856 13075712 12551426 11505980 9570249 13.7M 13634464 13568928 13437856 13175712 12651425 11605825 9666364 13.8M 13734464 13668928 13537856 13275712 12751425 11705689 9762618 13.9M 13834464 13768928 13637856 13375712 12851425 11805548 9858964 14.0M 13934464 13868928 13737856 13475712 12951425 11905437 9955306 14.1M 14034464 13968928 13837856 13575712 13051425 12005318 10051762 14.2M 14134464 14068928 13937856 13675712 13151425 12105187 10148339 14.3M 14234464 14168928 14037856 13775712 13251425 12205080 10245025 14.4M 14334464 14268928 14137856 13875712 13351425 12304974 10341792 14.5M 14434464 14368928 14237856 13975712 13451425 12404875 10438678 14.6M 14534464 14468928 14337856 14075712 13551425 12504772 10535607 14.7M 14634464 14568928 14437856 14175712 13651425 12604690 10632601 14.8M 14734464 14668928 14537856 14275712 13751425 12704618 10729595 14.9M 14834464 14768928 14637856 14375712 13851425 12804530 10826613 15.0M 14934464 14868928 14737856 14475712 13951425 12904462 10923845 15.1M 15034464 14968928 14837856 14575712 14051424 13004397 11021244 15.2M 15134464 15068928 14937856 14675712 14151424 13104310 11118579 15.3M 15234464 15168928 15037856 14775712 14251424 13204247 11215898 15.4M 15334464 15268928 15137856 14875712 14351424 13304182 11313297 15.5M 15434464 15368928 15237856 14975712 14451424 13404110 11410738 15.6M 15534464 15468928 15337856 15075712 14551424 13504040 11508202 15.7M 15634464 15568928 15437856 15175712 14651424 13603999 11605874 15.8M 15734464 15668928 15537856 15275712 14751424 13703953 11703560 15.9M 15834464 15768928 15637856 15375712 14851424 13803901 11801236 16.0M 15934464 15868928 15737856 15475712 14951424 13903861 11899051 16.1M 16034464 15968928 15837856 15575712 15051424 14003807 11996838 16.2M 16134464 16068928 15937856 15675712 15151424 14103752 12094750 16.3M 16234464 16168928 16037856 15775712 15251424 14203708 12192725 16.4M 16334464 16268928 16137856 15875712 15351424 14303666 12290669 16.5M 16434464 16368928 16237856 15975712 15451424 14403623 12388681 16.6M 16534464 16468928 16337856 16075712 15551424 14503585 12486733 16.7M 16634464 16568928 16437856 16175712 15651424 14603553 12584808 16.8M 16734464 16668928 16537856 16275712 15751424 14703524 12682912 16.9M 16834464 16768928 16637856 16375712 15851424 14803488 12781127 17.0M 16934464 16868928 16737856 16475712 15951424 14903456 12879337 17.1M 17034464 16968928 16837856 16575712 16051424 15003425 12977634 17.2M 17134464 17068928 16937856 16675712 16151424 15103396 13076030 17.3M 17234464 17168928 17037856 16775712 16251424 15203379 13174358 17.4M 17334464 17268928 17137856 16875712 16351424 15303355 13272762 17.5M 17434464 17368928 17237856 16975712 16451424 15403335 13371202 17.6M 17534464 17468928 17337856 17075712 16551424 15503319 13469702 17.7M 17634464 17568928 17437856 17175712 16651424 15603292 13568257 17.8M 17734464 17668928 17537856 17275712 16751424 15703269 13666849 17.9M 17834464 17768928 17637856 17375712 16851424 15803253 13765429 18.0M 17934464 17868928 17737856 17475712 16951424 15903234 13863977 18.1M 18034464 17968928 17837856 17575712 17051424 16003219 13962602 18.2M 18134464 18068928 17937856 17675712 17151424 16103198 14061250 SAMPLES CRC30 CRC31 CRC32 CRC33 CRC34 CRC35 CRC36 0.1M 5 1 3 0 0 0 0 0.2M 14 12 5 3 0 1 0 0.3M 40 24 7 8 6 3 1 0.4M 73 37 20 10 9 3 3 0.5M 110 65 29 16 12 4 4 0.6M 161 86 44 22 14 6 5 0.7M 219 121 66 33 14 8 5 0.8M 292 151 84 41 19 9 5 0.9M 370 195 104 53 26 11 5 1.0M 455 238 124 68 29 12 6 1.1M 557 281 149 78 32 15 8 1.2M 669 350 178 88 38 17 12 1.3M 786 401 213 93 42 19 14 1.4M 924 472 240 105 43 24 14 1.5M 1055 533 265 120 50 29 16 1.6M 1222 592 302 133 58 37 19 1.7M 1364 662 345 152 61 42 24 1.8M 1520 744 378 171 74 47 25 1.9M 1700 825 413 192 90 54 28 2.0M 1905 910 465 219 108 60 30 2.1M 2125 1004 528 239 116 68 33 2.2M 2335 1121 587 270 124 78 37 2.3M 2537 1210 632 288 136 86 43 2.4M 2742 1328 680 314 151 95 48 2.5M 2974 1446 747 348 167 99 51 2.6M 3198 1533 808 375 180 110 56 2.7M 3455 1655 882 417 194 117 58 2.8M 3705 1772 954 447 212 125 63 2.9M 3959 1895 1010 482 231 143 65 3.0M 4220 2023 1085 509 250 157 69 3.1M 4492 2181 1153 547 268 162 70 3.2M 4759 2326 1238 582 292 171 73 3.3M 5075 2469 1339 623 311 182 76 3.4M 5401 2633 1427 673 333 191 80 3.5M 5677 2779 1506 708 357 205 93 3.6M 6026 2951 1581 758 384 218 97 3.7M 6364 3121 1669 804 413 232 100 3.8M 6708 3283 1757 835 430 244 103 3.9M 7076 3471 1834 880 452 255 106 4.0M 7439 3661 1927 919 473 266 113 4.1M 7833 3841 2027 962 499 270 117 4.2M 8246 4053 2112 1007 533 278 120 4.3M 8627 4254 2205 1047 554 291 124 4.4M 9033 4448 2290 1100 573 302 125 4.5M 9468 4661 2403 1153 604 313 130 4.6M 9914 4853 2497 1195 625 327 138 4.7M 10357 5078 2584 1253 646 340 143 4.8M 10802 5290 2696 1300 679 349 148 4.9M 11251 5503 2812 1350 704 364 154 5.0M 11717 5751 2936 1400 737 375 160 5.1M 12162 5962 3049 1458 770 391 165 5.2M 12657 6200 3175 1526 789 406 172 5.3M 13148 6434 3293 1591 822 417 178 5.4M 13633 6667 3436 1654 864 430 188 5.5M 14097 6921 3553 1723 910 448 199 5.6M 14572 7158 3667 1777 944 459 210 5.7M 15059 7425 3799 1832 971 478 218 5.8M 15564 7700 3935 1895 1004 495 223 5.9M 16091 7976 4067 1950 1037 509 229 6.0M 16659 8246 4215 2026 1073 534 236 6.1M 17254 8532 4362 2095 1112 555 244 6.2M 17798 8790 4510 2157 1148 570 248 6.3M 18420 9085 4651 2245 1187 590 258 6.4M 19001 9380 4825 2300 1225 601 268 6.5M 19592 9678 4964 2365 1248 615 276 6.6M 20205 9987 5119 2441 1287 637 284 6.7M 20808 10297 5259 2531 1331 650 294 6.8M 21472 10625 5412 2600 1361 676 302 6.9M 22096 10941 5548 2675 1406 701 313 7.0M 22729 11258 5715 2748 1448 721 321 7.1M 23342 11558 5879 2836 1486 746 332 7.2M 24041 11916 6019 2924 1532 763 342 7.3M 24704 12273 6168 3009 1567 782 350 7.4M 25330 12603 6336 3112 1605 799 360 7.5M 26026 12970 6498 3198 1652 824 376 7.6M 26735 13314 6696 3274 1709 839 380 7.7M 27454 13674 6875 3371 1757 861 392 7.8M 28206 14045 7054 3481 1802 887 399 7.9M 28985 14434 7249 3573 1842 913 410 8.0M 29710 14794 7438 3687 1883 938 416 8.1M 30449 15167 7621 3779 1917 958 428 8.2M 31227 15563 7825 3868 1976 988 440 8.3M 31961 15903 8007 3963 2018 1013 454 8.4M 32797 16276 8198 4057 2069 1040 467 8.5M 33583 16681 8425 4150 2125 1059 476 8.6M 34361 17108 8654 4256 2172 1082 483 8.7M 35178 17523 8852 4373 2223 1111 498 8.8M 36012 17952 9038 4470 2270 1133 506 8.9M 36815 18365 9245 4563 2325 1163 516 9.0M 37651 18780 9479 4665 2368 1186 529 9.1M 38487 19235 9680 4778 2424 1213 546 9.2M 39342 19662 9904 4908 2463 1236 558 9.3M 40204 20111 10096 5015 2512 1264 568 9.4M 41091 20551 10331 5124 2560 1293 580 9.5M 41938 21011 10555 5214 2601 1332 597 9.6M 42800 21427 10769 5332 2662 1367 611 9.7M 43735 21870 10981 5447 2711 1388 625 9.8M 44634 22288 11210 5573 2773 1426 644 9.9M 45530 22731 11436 5686 2835 1449 652 10.0M 46438 23254 11632 5806 2895 1468 673 10.1M 47382 23687 11873 5923 2940 1493 686 10.2M 48408 24141 12107 6042 2996 1518 703 10.3M 49328 24617 12346 6165 3070 1544 710 10.4M 50264 25093 12593 6302 3138 1570 728 10.5M 51204 25574 12855 6426 3194 1608 741 10.6M 52219 26095 13111 6542 3263 1639 758 10.7M 53182 26614 13358 6659 3333 1666 772 10.8M 54136 27110 13599 6774 3404 1694 787 10.9M 55135 27646 13864 6895 3464 1723 805 11.0M 56179 28181 14130 7037 3513 1766 827 11.1M 57241 28667 14358 7151 3581 1795 838 11.2M 58307 29175 14617 7287 3644 1832 852 11.3M 59374 29686 14885 7417 3710 1870 872 11.4M 60438 30202 15161 7563 3786 1897 890 11.5M 61468 30806 15414 7693 3861 1934 909 11.6M 62586 31353 15707 7843 3913 1971 925 11.7M 63662 31921 15995 7975 3980 2007 939 11.8M 64767 32464 16272 8121 4049 2039 953 11.9M 65897 32981 16545 8269 4108 2076 967 12.0M 66985 33509 16845 8415 4172 2124 985 12.1M 68102 34069 17123 8547 4237 2156 1005 12.2M 69190 34659 17398 8677 4303 2185 1018 12.3M 70382 35204 17669 8825 4386 2242 1038 12.4M 71516 35825 17955 8962 4458 2280 1061 12.5M 72756 36455 18259 9090 4542 2310 1071 12.6M 73997 37059 18549 9209 4629 2342 1080 12.7M 75137 37678 18854 9351 4708 2363 1103 12.8M 76299 38247 19150 9491 4785 2408 1124 12.9M 77493 38850 19471 9662 4866 2442 1141 13.0M 78651 39403 19777 9796 4936 2481 1160 13.1M 79844 40002 20081 9967 4999 2513 1174 13.2M 81058 40633 20368 10107 5081 2543 1194 13.3M 82236 41261 20669 10240 5151 2585 1215 13.4M 83469 41874 20970 10393 5233 2622 1234 13.5M 84700 42521 21304 10573 5326 2662 1254 13.6M 85951 43170 21652 10747 5399 2709 1277 13.7M 87223 43782 21981 10896 5501 2754 1300 13.8M 88494 44437 22300 11024 5571 2795 1318 13.9M 89791 45049 22605 11176 5662 2832 1340 14.0M 91070 45680 22967 11342 5743 2874 1358 14.1M 92347 46305 23306 11497 5834 2933 1383 14.2M 93635 46972 23656 11701 5917 2976 1401 14.3M 95019 47648 23981 11870 5985 3035 1426 14.4M 96365 48364 24299 12019 6057 3068 1446 14.5M 97729 49043 24620 12203 6130 3120 1471 14.6M 99114 49774 24949 12355 6207 3156 1488 14.7M 100474 50460 25291 12531 6282 3199 1513 14.8M 101838 51157 25664 12678 6348 3238 1546 14.9M 103199 51886 26018 12852 6447 3279 1578 15.0M 104561 52562 26337 13045 6544 3317 1604 15.1M 105950 53225 26686 13225 6656 3366 1622 15.2M 107447 53905 27040 13395 6746 3411 1644 15.3M 108912 54637 27370 13572 6837 3448 1667 15.4M 110277 55329 27727 13724 6933 3501 1687 15.5M 111673 56046 28109 13911 7025 3535 1714 15.6M 113141 56768 28469 14101 7094 3580 1733 15.7M 114587 57501 28818 14277 7174 3630 1760 15.8M 116054 58230 29180 14451 7258 3686 1786 15.9M 117459 58962 29544 14622 7354 3742 1807 16.0M 118907 59704 29923 14827 7466 3791 1830 16.1M 120412 60447 30307 15029 7563 3847 1847 16.2M 121895 61164 30692 15190 7664 3894 1866 16.3M 123428 61928 31046 15393 7752 3939 1891 16.4M 124961 62691 31444 15576 7839 3991 1920 16.5M 126444 63473 31815 15776 7948 4043 1938 16.6M 127945 64235 32207 16004 8046 4097 1962 16.7M 129517 64984 32588 16230 8148 4144 1984 16.8M 131019 65739 32974 16438 8244 4194 2010 16.9M 132553 66529 33358 16632 8351 4248 2036 17.0M 134113 67326 33756 16835 8444 4290 2060 17.1M 135661 68138 34135 17032 8553 4344 2086 17.2M 137279 68952 34510 17234 8665 4387 2114 17.3M 138840 69781 34891 17448 8765 4436 2136 17.4M 140575 70594 35276 17629 8858 4483 2161 17.5M 142290 71396 35726 17807 8955 4521 2189 17.6M 143864 72236 36174 17994 9072 4561 2214 17.7M 145485 73014 36600 18204 9167 4637 2241 17.8M 147093 73825 36971 18396 9261 4682 2260 17.9M 148720 74638 37388 18586 9357 4735 2289 18.0M 150358 75498 37804 18802 9452 4801 2305 18.1M 152014 76347 38195 19014 9551 4861 2324 18.2M 153722 77254 38638 19232 9652 4914 2343 SAMPLES CRC58 CRC59 CRC60 CRC61 CRC62 CRC63 CRC64 0.1M 0 0 0 0 0 0 0 0.2M 0 0 0 0 0 0 0 0.3M 0 0 0 0 0 0 0 0.4M 0 0 0 0 0 0 0 0.5M 0 0 0 0 0 0 0 0.6M 0 0 0 0 0 0 0 0.7M 0 0 0 0 0 0 0 0.8M 0 0 0 0 0 0 0 0.9M 0 0 0 0 0 0 0 1.0M 0 0 0 0 0 0 0 1.1M 0 0 0 0 0 0 0 1.2M 0 0 0 0 0 0 0 1.3M 0 0 0 0 0 0 0 1.4M 0 0 0 0 0 0 0 1.5M 0 0 0 0 0 0 0 1.6M 0 0 0 0 0 0 0 1.7M 0 0 0 0 0 0 0 1.8M 0 0 0 0 0 0 0 1.9M 0 0 0 0 0 0 0 2.0M 0 0 0 0 0 0 0 2.1M 0 0 0 0 0 0 0 2.2M 0 0 0 0 0 0 0 2.3M 0 0 0 0 0 0 0 2.4M 0 0 0 0 0 0 0 2.5M 0 0 0 0 0 0 0 2.6M 0 0 0 0 0 0 0 2.7M 0 0 0 0 0 0 0 2.8M 0 0 0 0 0 0 0 2.9M 0 0 0 0 0 0 0 3.0M 0 0 0 0 0 0 0 3.1M 0 0 0 0 0 0 0 3.2M 0 0 0 0 0 0 0 3.3M 0 0 0 0 0 0 0 3.4M 0 0 0 0 0 0 0 3.5M 0 0 0 0 0 0 0 3.6M 0 0 0 0 0 0 0 3.7M 0 0 0 0 0 0 0 3.8M 0 0 0 0 0 0 0 3.9M 0 0 0 0 0 0 0 4.0M 0 0 0 0 0 0 0 4.1M 0 0 0 0 0 0 0 4.2M 0 0 0 0 0 0 0 4.3M 0 0 0 0 0 0 0 4.4M 0 0 0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 0 0 0 0 0 0 15.3M 0 0 0 0 0 0 0 15.4M 0 0 0 0 0 0 0 15.5M 0 0 0 0 0 0 0 15.6M 0 0 0 0 0 0 0 15.7M 0 0 0 0 0 0 0 15.8M 0 0 0 0 0 0 0 15.9M 0 0 0 0 0 0 0 16.0M 0 0 0 0 0 0 0 16.1M 0 0 0 0 0 0 0 16.2M 0 0 0 0 0 0 0 16.3M 0 0 0 0 0 0 0 16.4M 0 0 0 0 0 0 0 16.5M 0 0 0 0 0 0 0 16.6M 0 0 0 0 0 0 0 16.7M 0 0 0 0 0 0 0 16.8M 0 0 0 0 0 0 0 16.9M 0 0 0 0 0 0 0 17.0M 0 0 0 0 0 0 0 17.1M 0 0 0 0 0 0 0 17.2M 0 0 0 0 0 0 0 17.3M 0 0 0 0 0 0 0 17.4M 0 0 0 0 0 0 0 17.5M 0 0 0 0 0 0 0 17.6M 0 0 0 0 0 0 0 17.7M 0 0 0 0 0 0 0 17.8M 0 0 0 0 0 0 0 17.9M 0 0 0 0 0 0 0 18.0M 0 0 0 0 0 0 0 18.1M 0 0 0 0 0 0 0 18.2M 0 0 0 0 0 0 0
/* * UTIL/CRCTEST.C - CRC tester, by Matt Dillon * * This program is designed to test an N-bit CRC against a word dictionary * which you pipe into it. It is not required for normal diablo operation. * * Warning: This program will eat a lot of memory with large sets. If the * set is known to be unique, you can use -u to reduce the memory footprint. * * cat unique-words | CRCTEST [-u] [-v] [-q] [-h#] * * -h# set final hash size, in bits 16-64, Default is 64 bits. * -u assume unique input, do not store string contents * -v verbose output, print collisions * -q quiet output, do not print the count every 100,000 tests * * The expected number of collisions is (NSAMP * (NSAMP-1) / 2) / 2^CRCBITS. * * This is calculated through statistics. If you had 7 samples and an 8 bit * CRC (256 slots), the number of collisions is * * sample #1 0/256 * sample #2 1/256 * sample #3 2/256 * sample #4 3/256 * sample #5 4/256 * sample #6 5/256 * sample #7 6/256 * + sample #8 7/256 * ------------------------------ * [ 8*(8-1)/2 ] / 2^CRCBITS * * NOTE!! this only works if 2^CRCBITS is substantially larger then NSAMP * because we aren't taking into account the fact that a prior samples * may collide and not increment the chance of collision for later * samples. * * So, for example, a 36 bit CRC with 1M samples should result in around 7 * collisions. A 42 bit CRC with 1M samples should result in around 0.1 * collision. A 42 bit CRC with 3 million samples should result in around 1 * collision. */ #include #include #include #include typedef unsigned int hint_t; /* we want a 32 bit unsigned integer here */ typedef struct hash_t { hint_t h1; hint_t h2; } hash_t; typedef struct Hash { struct Hash *ha_Next; hash_t ha_Hv; } Hash; #define TESTHSIZE (4 * 1024 * 1024) #define TESTHMASK (TESTHSIZE - 1) void inithash(void); hash_t testhash(const char *p); Hash *HashAry[TESTHSIZE]; int UniqueOpt; int HashLimit = 64; int VerboseOpt = 0; int QuietOpt = 0; void *rmalloc(int bytes); int main(int ac, char **av) { char buf[256]; int count = 0; int total = 0; int skip = 100000; int i; for (i = 1; i < ac; ++i) { char *p = av[i]; if (*p == '-') { p += 2; switch(p[-1]) { case 'u': UniqueOpt = 1; break; case 'h': /* * We can't go above 64 for obvious reasons. We can't go * below 16 due to the way I generate the polynomial. */ HashLimit = strtol(p, NULL, 0); if (HashLimit > 64 || HashLimit < 16) { printf("valid values for -h between 16 & 64 inclusive\n"); exit(1); } break; case 'q': QuietOpt = 1; break; case 'v': VerboseOpt = 1; break; default: fprintf(stderr, "Unknown option: %s\n", p - 2); exit(1); } } } inithash(); while (fgets(buf, sizeof(buf), stdin) != NULL) { int i; hash_t hv; Hash *h; char *s; for (s = strtok(buf, " ,\t\r\n"); s; s = strtok(NULL, " ,\t\r\n")) { hv = testhash(s); i = (hv.h1 ^ hv.h2) & TESTHMASK; /* printf("%08x.%08x (%d) %s\n", hv.h1, hv.h2, i, s); */ for (h = HashAry[i]; h; h = h->ha_Next) { if (h->ha_Hv.h1 == hv.h1 && h->ha_Hv.h2 == hv.h2) { if (UniqueOpt || strcmp(s, (char *)(h + 1)) != 0) { if (VerboseOpt) { printf("Collision: %s\t%s\n", s, ((UniqueOpt) ? "?" : (char *)(h + 1)) ); } ++count; ++total; } break; } } if (h == NULL) { h = rmalloc(sizeof(Hash) + ((UniqueOpt) ? 0 : strlen(s) + 1)); h->ha_Next = HashAry[i]; h->ha_Hv = hv; if (UniqueOpt == 0) strcpy((char *)(h + 1), s); HashAry[i] = h; ++total; } } if (total >= skip) { if (QuietOpt == 0) { printf("Count %d/%d\n", count, total); fflush(stdout); } skip += 100000; } } printf("Count %d/%d\n", count, total); return(0); } /* * Poly: 0x00600340.00F0D50A * */ #define HINIT1 0xFAC432B1UL #define HINIT2 0x0CD5E44AUL #define POLY1 0x00600340UL #define POLY2 0x00F0D50BUL hash_t CrcXor[256]; hash_t Poly[64+1]; void inithash(void) { int i; /* * Polynomials to use for various crc sizes. Start with the 64 bit * polynomial and shift it right to generate the polynomials for fewer * bits. Note that the polynomial for N bits has no bit set above N-8. * This allows us to do a simple table-driven CRC. */ Poly[64].h1 = POLY1; Poly[64].h2 = POLY2; for (i = 63; i >= 16; --i) { Poly[i].h1 = Poly[i+1].h1 >> 1; Poly[i].h2 = (Poly[i+1].h2 >> 1) | ((Poly[i+1].h1 & 1) << 31) | 1; } for (i = 0; i < 256; ++i) { int j; int v = i; hash_t hv = { 0, 0 }; for (j = 0; j < 8; ++j, (v <<= 1)) { hv.h1 <<= 1; if (hv.h2 & 0x80000000UL) hv.h1 |= 1; hv.h2 = (hv.h2 << 1); if (v & 0x80) { hv.h1 ^= Poly[HashLimit].h1; hv.h2 ^= Poly[HashLimit].h2; } } CrcXor[i] = hv; } } /* * testhash() - do the CRC. The complexity is simply due to the programmable * nature of the number of bits. We extract the top 8 bits to * use as a table lookup to obtain the polynomial XOR 8 bits at * a time rather then 1 bit at a time. */ hash_t testhash(const char *p) { hash_t hv = { HINIT1, HINIT2 }; if (HashLimit <= 32) { int s = HashLimit - 8; hint_t m = (hint_t)-1 >> (32 - HashLimit); hv.h1 = 0; hv.h2 &= m; while (*p) { int i = (hv.h2 >> s) & 255; /* printf("i = %d %08lx\n", i, CrcXor[i].h2); */ hv.h2 = ((hv.h2 << 8) & m) ^ *p ^ CrcXor[i].h2; ++p; } } else if (HashLimit < 32+8) { int s2 = 32 + 8 - HashLimit; /* bits in byte from h2 */ hint_t m = (hint_t)-1 >> (64 - HashLimit); hv.h1 &= m; while (*p) { int i = ((hv.h1 << s2) | (hv.h2 >> (32 - s2))) & 255; hv.h1 = (((hv.h1 << 8) ^ (int)(hv.h2 >> 24)) & m) ^ CrcXor[i].h1; hv.h2 = (hv.h2 << 8) ^ *p ^ CrcXor[i].h2; ++p; } } else { int s = HashLimit - 40; hint_t m = (hint_t)-1 >> (64 - HashLimit); hv.h1 &= m; while (*p) { int i = (hv.h1 >> s) & 255; hv.h1 = ((hv.h1 << 8) & m) ^ (int)(hv.h2 >> 24) ^ CrcXor[i].h1; hv.h2 = (hv.h2 << 8) ^ *p ^ CrcXor[i].h2; ++p; } } /* printf("%08lx.%08lx\n", (long)hv.h1, (long)hv.h2); */ return(hv); } void * rmalloc(int bytes) { static char *RBuf = NULL; static int RSize = 0; bytes = (bytes + 3) & ~3; if (bytes > RSize) { RBuf = malloc(65536); RSize = 65536; } RBuf += bytes; RSize -= bytes; return(RBuf - bytes); }