@taichunmin/crc
Version:
A cross platform alternative for calculating Cyclic Redundancy Checks (CRC) values.
2 lines (1 loc) • 1.98 kB
JavaScript
;(()=>{function F(x){let A=typeof x;return x!=null&&(A==="object"||A==="function")}function t(x,A,C){if(!F(x)||!Array.isArray(A)||A.length<1)return x;let E=x;for(let D of A.slice(0,-1))F(E[D])||(E[D]={}),E=E[D];return E[A.at(-1)]=C,x}var e=new Uint8Array(1),B=new Uint16Array(1),o=new Uint32Array(1);var n=new Uint16Array([0,35767,40153,5998,45573,14770,11996,42347,61373,25610,29540,63699,23992,54799,49505,19158,21709,57210,51220,17315,59080,28031,31249,61862,47984,12487,10153,44062,2421,33474,38316,7707,43418,8749,13635,48884,7071,36904,34630,3313,17959,52624,56062,20809,62498,32661,26875,58188,64855,30432,24974,59961,20306,50405,54155,22588,4842,39261,36403,1412,41199,11096,15414,46977,55427,21300,17498,53229,27270,57649,63071,32232,14142,48265,44007,8272,34107,3724,6626,37461,35918,2041,4247,39712,15947,46588,41618,10533,25587,59460,65322,29853,53750,23105,19759,50840,28953,64174,60864,26231,49948,18603,24517,54386,40612,5395,637,35274,11425,42774,45176,15311,9684,44643,47373,12986,38865,7270,2824,32959,51817,16862,22192,56583,30828,62427,58549,28418,15025,45318,42600,11743,34996,771,5229,40922,54540,24251,18901,49762,26377,60606,64464,28775,28284,58827,62117,30994,56441,22478,16544,51991,33217,2678,7448,38575,13252,47219,44829,9386,37675,6300,4082,33861,8494,43673,48631,13888,31894,63265,57423,27640,52883,17700,21066,55805,51174,19537,23359,53384,30179,65108,59706,25229,10331,41964,46210,16181,39518,4585,1671,36144,57906,27013,32491,62812,20535,56192,52462,18265,3471,34360,37206,6881,49034,13373,9043,43236,46847,15688,10790,41361,1274,36685,38947,5012,22850,54005,50587,20012,60231,24816,30622,64553,19368,49183,55153,23750,63917,29210,25972,61123,42005,12194,14540,45947,5648,40359,35529,382,8037,38098,33724,2059,44384,9943,12729,47630,61656,31599,27649,59318,17117,51562,56836,21939]);function r(x=new Uint8Array,A=0){B[0]=A;for(let C of x)B[0]=n[B[0]>>>8^C]^B[0]<<8;return B[0]}t(globalThis,["taichunmin","crc","crc16t10dif"],r);})();