UNPKG

@taichunmin/crc

Version:

A cross platform alternative for calculating Cyclic Redundancy Checks (CRC) values.

2 lines (1 loc) 3.23 kB
"use strict";(()=>{function F(x){let A=typeof x;return x!=null&&(A==="object"||A==="function")}function r(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),o=new Uint16Array(1),B=new Uint32Array(1);var n=new Uint32Array([0,2168537515,2210644733,42107734,2261173329,126322170,84215468,2219067143,2362231049,227379362,252644340,2387495519,168430936,2336967923,2311704485,143166990,2564346809,429494802,454758724,2589610223,505288680,2673825347,2648560917,480023742,336861872,2505399067,2547505229,378968550,2463293153,328441674,286333980,2421185975,2968577753,833726322,858989604,2993841551,909517448,3078054691,3052789877,884253150,1010577360,3179114107,3221220653,1052683398,3137006465,1002154538,960047484,3094898903,673723744,2842260683,2884368285,715830838,2934894897,800043162,757937100,2892788327,2766470249,631619010,656883348,2791735103,572667960,2741205395,2715941573,547404654,3768618009,1642188210,1667452644,3793882959,1717979208,3878095331,3852831413,1692715806,1819034896,3979150523,4021258221,1861142086,3937042753,1810612458,1768506300,3894936087,2021154720,4181270027,4223376733,2063260918,4273904625,2147474010,2105366796,4231796903,4105475753,1979045634,2004309076,4130739711,1920094968,4080210771,4054945797,1894830510,1347447488,3507563371,3549669437,1389554070,3600199313,1473769274,1431661676,3558092231,3701253065,1574822498,1600086324,3726516383,1515874200,3675989555,3650725221,1490609358,3364403577,1237973202,1263238020,3389667887,1313766696,3473882243,3448618965,1288502910,1145335920,3305451995,3347559053,1187443494,3263345697,1136915850,1094809308,3221239671,1073764761,3242268722,3284376420,1115871951,3334905288,1200086115,1157979957,3292798622,3435958416,1301139771,1326404205,3461223366,1242191041,3410695530,3385431612,1216927639,3638069792,1503251339,1528514781,3663333750,1579044465,3747549146,3722284172,1553780007,1410614057,3579118210,3621224916,1452720255,3537012600,1402193619,1360086405,3494904878,4042309440,1907490539,1932754365,4067572758,1983281937,4151786170,4126521836,1958017095,2084337225,4252841954,4294948020,2126443807,4210733592,2075915187,2033807589,4168626510,1747479801,3915984210,3958091268,1789587375,4008618152,1873799427,1831692885,3966512126,3840189936,1705370715,1730635533,3865454246,1646420385,3814924298,3789661020,1621156599,2694894976,568431659,593696637,2720159446,644223441,2804371578,2779108140,618959495,745282697,2905431330,2947538548,787390431,2863323352,736860531,694753829,2821217166,947390009,3107538834,3149644996,989496687,3200172648,1073710019,1031602325,3158065470,3031748400,905285275,930549197,3057011814,846334817,3006483146,2981218716,821069879,273691481,2433839858,2475946404,315797519,2526476040,400012963,357905909,2484368478,2627533392,501070843,526334125,2652797190,442121729,2602270634,2577005820,416857431,2290671840,164208971,189473309,2315936694,240002225,2400150810,2374886988,214738919,71576041,2231724098,2273831700,113683135,2189618616,63155219,21049157,2147512046]);function t(x=new Uint8Array,A=0){B[0]=A;for(let C of x)B[0]=n[B[0]>>>24^C]^B[0]<<8;return B[0]}r(globalThis,["taichunmin","crc","crc32q"],t);})();