3
// Note: we can't get significant speed boost here.
4
// So write code to minimize size - no pregenerated tables
5
// and array tools dependencies.
8
// Use ordinary array, since untyped makes no boost here
12
for (var n =0; n < 256; n++) {
14
for (var k =0; k < 8; k++) {
15
c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));
23
// Create table on load. Just 255 signed longs. Not a problem.
24
var crcTable = makeTable();
27
function crc32(crc, buf, len, pos) {
33
for (var i = pos; i < end; i++) {
34
crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];
37
return (crc ^ (-1)); // >>> 0;
41
module.exports = crc32;