@taichunmin/crc
Version:
A cross platform alternative for calculating Cyclic Redundancy Checks (CRC) values.
2 lines (1 loc) • 1.39 kB
JavaScript
;(()=>{function E(x){let r=typeof x;return x!=null&&(r==="object"||r==="function")}function e(x,r,A){if(!E(x)||!Array.isArray(r)||r.length<1)return x;let t=x;for(let B of r.slice(0,-1))E(t[B])||(t[B]={}),t=t[B];return t[r.at(-1)]=A,x}var n=new Uint8Array(1),F=new Uint16Array(1),c=new Uint32Array(1);var D=new Uint8Array([0,208,19,195,38,246,53,229,76,156,95,143,106,186,121,169,152,72,139,91,190,110,173,125,212,4,199,23,242,34,225,49,131,83,144,64,165,117,182,102,207,31,220,12,233,57,250,42,27,203,8,216,61,237,46,254,87,135,68,148,113,161,98,178,181,101,166,118,147,67,128,80,249,41,234,58,223,15,204,28,45,253,62,238,11,219,24,200,97,177,114,162,71,151,84,132,54,230,37,245,16,192,3,211,122,170,105,185,92,140,79,159,174,126,189,109,136,88,155,75,226,50,241,33,196,20,215,7,217,9,202,26,255,47,236,60,149,69,134,86,179,99,160,112,65,145,82,130,103,183,116,164,13,221,30,206,43,251,56,232,90,138,73,153,124,172,111,191,22,198,5,213,48,224,35,243,194,18,209,1,228,52,247,39,142,94,157,77,168,120,187,107,108,188,127,175,74,154,89,137,32,240,51,227,6,214,21,197,244,36,231,55,210,2,193,17,184,104,171,123,158,78,141,93,239,63,252,44,201,25,218,10,163,115,176,96,133,85,150,70,119,167,100,180,81,129,66,146,59,235,40,248,29,205,14,222]);function C(x=new Uint8Array,r=0){n[0]=r;for(let A of x)n[0]=D[n[0]^A];return n[0]}e(globalThis,["taichunmin","crc","crc8wcdma"],C);})();