@quentinadam/zip 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/crc32.js +2 -2
- package/package.json +4 -4
package/dist/crc32.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ensure from '@quentinadam/ensure';
|
|
2
2
|
const POLYNOMIAL = -306674912;
|
|
3
3
|
const TABLE = /* @__PURE__ */ (() => {
|
|
4
4
|
const table = new Int32Array(256);
|
|
@@ -13,7 +13,7 @@ const TABLE = /* @__PURE__ */ (() => {
|
|
|
13
13
|
})();
|
|
14
14
|
export default function crc32(buffer, crc = 0xFFFFFFFF) {
|
|
15
15
|
for (const byte of buffer) {
|
|
16
|
-
crc =
|
|
16
|
+
crc = ensure(TABLE[(crc ^ byte) & 0xff]) ^ (crc >>> 8);
|
|
17
17
|
}
|
|
18
18
|
return (crc ^ -1) >>> 0;
|
|
19
19
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quentinadam/zip",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "A library for creating and extracting ZIP archives",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Quentin Adam",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"README.md"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@quentinadam/assert": "^0.1.
|
|
19
|
-
"@quentinadam/
|
|
20
|
-
"@quentinadam/uint8array-extension": "^0.1.
|
|
18
|
+
"@quentinadam/assert": "^0.1.11",
|
|
19
|
+
"@quentinadam/ensure": "^0.1.0",
|
|
20
|
+
"@quentinadam/uint8array-extension": "^0.1.6"
|
|
21
21
|
}
|
|
22
22
|
}
|