UNPKG

@taichunmin/crc

Version:

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

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