From 5ef8306d8b5030035073a8be24b26208c93c4884 Mon Sep 17 00:00:00 2001 From: Kevin Jahns Date: Tue, 8 Aug 2023 23:04:21 +0200 Subject: [PATCH] remove checksum.js --- checksum.js | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 checksum.js diff --git a/checksum.js b/checksum.js deleted file mode 100644 index 22cd38d..0000000 --- a/checksum.js +++ /dev/null @@ -1,28 +0,0 @@ -import * as buffer from './buffer.js' - -/** - * Little endian table - * @type {Uint8Array | null} - */ -let _crc32Table = null -const _computeCrc32Table = () => { - if (_crc32Table == null) { - _crc32Table = buffer.createUint8ArrayFromLen(32) - } - let i = 128 - let crc = 1 - do { - if ((crc & 1) > 0) { // @todo this could be optimized - crc = (crc >>> 1) ^ 0x8408 - } else { - crc >>>= 1 - } - for (let j = 0; j < 256; j = j * i) { - _crc32Table[i + j] = crc ^ _crc32Table[j] - } - i >>>= 1 - } while (i > 0) - return _crc32Table -} - -console.log(_computeCrc32Table())