PHP 8.2.30
Preview: crc32.js Size: 790 B
/proc/thread-self/root/home/byroehnu/.trash/node_modules11/pako/lib/zlib/crc32.js

'use strict';

// Note: we can't get significant speed boost here.
// So write code to minimize size - no pregenerated tables
// and array tools dependencies.


// Use ordinary array, since untyped makes no boost here
function makeTable() {
  var c, table = [];

  for (var n = 0; n < 256; n++) {
    c = n;
    for (var k = 0; k < 8; k++) {
      c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));
    }
    table[n] = c;
  }

  return table;
}

// Create table on load. Just 255 signed longs. Not a problem.
var crcTable = makeTable();


function crc32(crc, buf, len, pos) {
  var t = crcTable,
      end = pos + len;

  crc ^= -1;

  for (var i = pos; i < end; i++) {
    crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];
  }

  return (crc ^ (-1)); // >>> 0;
}


module.exports = crc32;

Directory Contents

Dirs: 0 × Files: 11

Name Size Perms Modified Actions
694 B lrw-r--r-- 2026-02-14 19:19:12
Edit Download
1.32 KB lrw-r--r-- 2026-02-14 19:19:14
Edit Download
790 B lrw-r--r-- 2026-02-14 19:19:12
Edit Download
58.82 KB lrw-r--r-- 2026-02-14 19:19:12
Edit Download
1.25 KB lrw-r--r-- 2026-02-14 19:19:14
Edit Download
11.43 KB lrw-r--r-- 2026-02-14 19:19:14
Edit Download
46.25 KB lrw-r--r-- 2026-02-14 19:19:14
Edit Download
11.29 KB lrw-r--r-- 2026-02-14 19:19:14
Edit Download
577 B lrw-r--r-- 2026-02-14 19:19:14
Edit Download
37.97 KB lrw-r--r-- 2026-02-14 19:19:14
Edit Download
851 B lrw-r--r-- 2026-02-14 19:19:14
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).