UNPKG

@taichunmin/crc

Version:

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

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