UNPKG

@taichunmin/crc

Version:

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

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