This repository has been archived by the owner on Apr 2, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a much faster function as checkCRCHash
src: https://github.com/esterTion/BiliBili_crc2mid/blob/master/crc32.htm authored by https://github.com/esterTion minified checkCRCHash function: window.checkCRCHash=new function(){var h=function(){for(var d,e="undefined"!==typeof Int32Array?new Int32Array(256):Array(256),b=0;256!=b;++b){d=b;for(var c=0;8>c;c++)d=d&1?-306674912^d>>>1:d>>>1;e[b]=d}return e}(),f=Array(4);return function(d){var e=parseInt(d,16)^4294967295,b,c;for(d=3;0<=d;d--){a:{for(b=0;256>b;b++)if(h[b]>>>24==e>>>8*d)break a;b=-1}f[3-d]=b;b=h[f[3-d]];e^=b>>>8*(3-d)}for(d=0;1E5>d;d++){e=d;"string"!=typeof e&&(e=""+e);b=4294967295;for(var k=e.length,g=void 0,l=0;l<k;++l)g=(b^e.charCodeAt(l))& 255,b=b>>>8^h[g];e=g;if(e==f[3]){c=d;"string"!=typeof c&&(c=""+c);e=4294967295;b=c.length;for(g=0;g<b;++g)k=(e^c.charCodeAt(g))&255,e=e>>>8^h[k];b=e;c=b&255^f[2];57>=c&&48<=c?(e=""+(c-48),b=h[f[2]]^b>>>8,c=b&255^f[1],57>=c&&48<=c?(e+=c-48,b=h[f[1]]^b>>>8,c=b&255^f[0],c=57>=c&&48<=c?[1,e+(c-48)]:[0]):c=[0]):c=[0];if(c[0])break}}return 1E5==d?-1:d+""+c[1]}};
- Loading branch information