2014-06-16 21:27:47 +00:00
|
|
|
/* see perf/crc32table.js */
|
2016-06-16 20:49:46 +00:00
|
|
|
/*global Int32Array */
|
2015-05-06 21:47:18 +00:00
|
|
|
function signed_crc_table()/*:CRC32TableType*/ {
|
|
|
|
var c = 0, table/*:Array<number>*/ = new Array(256);
|
2014-06-16 21:27:47 +00:00
|
|
|
|
|
|
|
for(var n =0; n != 256; ++n){
|
|
|
|
c = n;
|
|
|
|
c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
|
|
|
|
c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
|
|
|
|
c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
|
|
|
|
c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
|
|
|
|
c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
|
|
|
|
c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
|
|
|
|
c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
|
|
|
|
c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
|
|
|
|
table[n] = c;
|
|
|
|
}
|
|
|
|
|
2014-06-17 23:20:41 +00:00
|
|
|
return typeof Int32Array !== 'undefined' ? new Int32Array(table) : table;
|
2014-06-16 21:27:47 +00:00
|
|
|
}
|
|
|
|
|
2016-06-16 20:49:46 +00:00
|
|
|
var T = signed_crc_table();
|