@zip.js/zip.js 2.8.43 → 2.8.45

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.
Files changed (56) hide show
  1. package/README.md +0 -37
  2. package/deno.json +21 -1
  3. package/dist/zip-core-external.js +194 -159
  4. package/dist/zip-core-external.min.js +1 -1
  5. package/dist/zip-core.js +194 -131
  6. package/dist/zip-core.min.js +1 -1
  7. package/dist/zip-fs-core-external.js +246 -167
  8. package/dist/zip-fs-core-external.min.js +1 -1
  9. package/dist/zip-fs-core.js +244 -139
  10. package/dist/zip-fs-core.min.js +1 -1
  11. package/dist/zip-fs-external.js +267 -1761
  12. package/dist/zip-fs-external.min.js +1 -1
  13. package/dist/zip-fs-native.js +269 -1735
  14. package/dist/zip-fs-native.min.js +1 -1
  15. package/dist/zip-fs.js +268 -1734
  16. package/dist/zip-fs.min.js +1 -1
  17. package/dist/zip-legacy.js +196 -133
  18. package/dist/zip-legacy.min.js +1 -1
  19. package/dist/zip-native.js +196 -133
  20. package/dist/zip-native.min.js +1 -1
  21. package/dist/zip-web-worker-native.js +1 -1
  22. package/dist/zip-web-worker.js +1 -1
  23. package/dist/zip.js +195 -132
  24. package/dist/zip.min.js +1 -1
  25. package/eslint.config.mjs +31 -2
  26. package/index-native.cjs +269 -1735
  27. package/index-native.min.js +1 -1
  28. package/index.cjs +268 -1734
  29. package/index.d.cts +129 -8
  30. package/index.d.ts +129 -8
  31. package/index.min.js +1 -1
  32. package/lib/core/codec-pool.js +6 -2
  33. package/lib/core/codec-worker.js +2 -2
  34. package/lib/core/constants.js +4 -0
  35. package/lib/core/options.js +6 -0
  36. package/lib/core/streams/aes-crypto-stream.js +18 -21
  37. package/lib/core/streams/codec-stream.js +6 -2
  38. package/lib/core/streams/common-crypto.js +2 -0
  39. package/lib/core/streams/zip-entry-stream.js +16 -17
  40. package/lib/core/util/mime-type-data.js +3 -0
  41. package/lib/core/util/mime-type.js +23 -1596
  42. package/lib/core/web-worker-base.js +2 -2
  43. package/lib/core/web-worker-inline-native.js +1 -1
  44. package/lib/core/web-worker-inline-wasm.js +1 -1
  45. package/lib/core/web-worker-wasm.js +4 -8
  46. package/lib/core/zip-entry.js +11 -1
  47. package/lib/core/zip-fs.js +62 -5
  48. package/lib/core/zip-reader.js +80 -43
  49. package/lib/core/zip-writer.js +68 -45
  50. package/lib/zip-core-external.js +2 -0
  51. package/lib/zip-core-reader.js +2 -0
  52. package/lib/zip-fs-core-external.js +2 -0
  53. package/lib/zip-fs-external.js +2 -0
  54. package/lib/zip-mime-types.js +2 -0
  55. package/package.json +9 -3
  56. package/worker-message-property-names.js +1 -1
package/index.d.cts CHANGED
@@ -1164,8 +1164,8 @@ export interface ZipReaderOptions {
1164
1164
  * file header of the entry disagrees with its central directory record in a way that could make other tools
1165
1165
  * (e.g. streaming readers based on local file headers) interpret the entry differently. This detects mismatched
1166
1166
  * filenames, general purpose bit flags (encryption, data descriptor and language encoding flags), compression
1167
- * methods, signatures and sizes. The extra fields are not compared because the zip specification allows them
1168
- * to differ.
1167
+ * methods, CRC-32 checksums and sizes. The extra fields are not compared because the zip specification allows
1168
+ * them to differ.
1169
1169
  *
1170
1170
  * @defaultValue false
1171
1171
  */
@@ -1177,7 +1177,24 @@ export interface ZipReaderOptions {
1177
1177
  */
1178
1178
  checkPasswordOnly?: boolean;
1179
1179
  /**
1180
- * `true` to check the signature of the entry.
1180
+ * `true` to verify the CRC-32 checksum of the entry against the value stored in the zip file. The verification
1181
+ * is run on the decompressed data and covers the whole read pipeline. It also applies to entries encrypted with
1182
+ * AES in AE-1 format. It is skipped for entries in AE-2 format because they store a zeroed CRC-32 value.
1183
+ *
1184
+ * @defaultValue false
1185
+ */
1186
+ checkCrc32?: boolean;
1187
+ /**
1188
+ * `true` to verify the authentication code of entries encrypted with AES. The verification detects encrypted
1189
+ * data tampered or corrupted after the encryption.
1190
+ *
1191
+ * @defaultValue true
1192
+ */
1193
+ checkAuthenticationCode?: boolean;
1194
+ /**
1195
+ * `true` to check the CRC-32 checksum of the entry.
1196
+ *
1197
+ * @deprecated Use {@link ZipReaderOptions#checkCrc32} instead.
1181
1198
  *
1182
1199
  * @defaultValue false
1183
1200
  */
@@ -1261,11 +1278,44 @@ export interface EntryExtraFieldAES extends EntryExtraField {
1261
1278
  * The encryption strength (1, 2 or 3).
1262
1279
  */
1263
1280
  strength?: number;
1281
+ /**
1282
+ * The vendor version (1 for AE-1, 2 for AE-2). Entries in AE-1 format store the CRC-32 checksum of the content,
1283
+ * entries in AE-2 format store a zeroed value.
1284
+ */
1285
+ vendorVersion?: number;
1286
+ /**
1287
+ * The vendor identifier.
1288
+ */
1289
+ vendorId?: number;
1264
1290
  /**
1265
1291
  * The compression method stored in the AES extra field.
1266
1292
  */
1267
1293
  originalCompressionMethod?: number;
1268
1294
  }
1295
+ /**
1296
+ * Represents a Unix extra field record storing timestamps: the Info-ZIP Unix type 1 extra field (0x5855),
1297
+ * written notably by macOS Archive Utility and `ditto`, or the PKWARE Unix extra field (0x000d). Both store
1298
+ * the last access/modification dates as 32-bit Unix times, followed by the optional uid/gid in the local
1299
+ * file header.
1300
+ */
1301
+ export interface EntryExtraFieldUnixDates extends EntryExtraField {
1302
+ /**
1303
+ * The last access date.
1304
+ */
1305
+ lastAccessDate?: Date;
1306
+ /**
1307
+ * The last modification date.
1308
+ */
1309
+ lastModDate?: Date;
1310
+ /**
1311
+ * The Unix user id.
1312
+ */
1313
+ uid?: number;
1314
+ /**
1315
+ * The Unix group id.
1316
+ */
1317
+ gid?: number;
1318
+ }
1269
1319
  /**
1270
1320
  * Represents a Unicode path or comment extra field record of an entry.
1271
1321
  */
@@ -1319,8 +1369,14 @@ export interface LocalDirectory {
1319
1369
  * The extra field.
1320
1370
  */
1321
1371
  extraField?: Map<number, EntryExtraField>;
1372
+ /**
1373
+ * The CRC-32 checksum of the content.
1374
+ */
1375
+ crc32?: number;
1322
1376
  /**
1323
1377
  * The signature (CRC32 checksum) of the content.
1378
+ *
1379
+ * @deprecated Use {@link LocalDirectory#crc32} instead.
1324
1380
  */
1325
1381
  signature?: number;
1326
1382
  /**
@@ -1355,6 +1411,14 @@ export interface LocalDirectory {
1355
1411
  * The Info-ZIP Unix extra field.
1356
1412
  */
1357
1413
  extraFieldInfoZip?: EntryExtraField;
1414
+ /**
1415
+ * The Info-ZIP Unix type 1 extra field (0x5855).
1416
+ */
1417
+ extraFieldUnixType1?: EntryExtraFieldUnixDates;
1418
+ /**
1419
+ * The PKWARE Unix extra field (0x000d).
1420
+ */
1421
+ extraFieldPkwareUnix?: EntryExtraFieldUnixDates;
1358
1422
  /**
1359
1423
  * The extended timestamp extra field.
1360
1424
  */
@@ -1462,9 +1526,17 @@ export interface EntryMetaData {
1462
1526
  */
1463
1527
  commentUTF8: boolean;
1464
1528
  /**
1465
- * The signature (CRC32 checksum) of the content.
1529
+ * The CRC-32 checksum of the content. It is `undefined` when the zip file does not store it, e.g. for entries
1530
+ * encrypted with AES in AE-2 format.
1531
+ */
1532
+ crc32?: number;
1533
+ /**
1534
+ * The signature (CRC32 checksum) of the content. It is `undefined` for entries encrypted with AES returned by
1535
+ * {@link ZipWriter#add}.
1536
+ *
1537
+ * @deprecated Use {@link EntryMetaData#crc32} instead.
1466
1538
  */
1467
- signature: number;
1539
+ signature?: number;
1468
1540
  /**
1469
1541
  * The extra field.
1470
1542
  */
@@ -1620,6 +1692,14 @@ export interface EntryMetaData {
1620
1692
  * The Info-ZIP Unix extra field.
1621
1693
  */
1622
1694
  extraFieldInfoZip?: EntryExtraField;
1695
+ /**
1696
+ * The Info-ZIP Unix type 1 extra field (0x5855).
1697
+ */
1698
+ extraFieldUnixType1?: EntryExtraFieldUnixDates;
1699
+ /**
1700
+ * The PKWARE Unix extra field (0x000d).
1701
+ */
1702
+ extraFieldPkwareUnix?: EntryExtraFieldUnixDates;
1623
1703
  /**
1624
1704
  * The extended timestamp extra field.
1625
1705
  */
@@ -1928,15 +2008,29 @@ export interface ZipWriterAddDataOptions
1928
2008
  */
1929
2009
  comment?: string;
1930
2010
  /**
1931
- * The extra field of the entry.
2011
+ * The extra field of the entry, written in the local file header and the central directory.
1932
2012
  */
1933
2013
  extraField?: Map<number, Uint8Array>;
2014
+ /**
2015
+ * The extra field of the entry written only in the local file header.
2016
+ */
2017
+ localExtraField?: Map<number, Uint8Array>;
1934
2018
  /**
1935
2019
  * The uncompressed size of the entry. This option is ignored if the {@link ZipWriterConstructorOptions#passThrough} option is not set to `true`.
1936
2020
  */
1937
2021
  uncompressedSize?: number;
2022
+ /**
2023
+ * The CRC-32 checksum of the content. This option is ignored if the {@link ZipWriterConstructorOptions#passThrough} option is not set to `true`.
2024
+ *
2025
+ * When the entry is AES-encrypted (see {@link ZipWriterConstructorOptions#encrypted}), setting this option marks the entry as AE-1
2026
+ * and stores the checksum in the entry headers, e.g. when copying an AE-1 entry read with the
2027
+ * {@link ZipReaderOptions#passThrough} option. Otherwise, the entry is marked as AE-2 and the checksum fields are set to 0.
2028
+ */
2029
+ crc32?: number;
1938
2030
  /**
1939
2031
  * The signature (CRC32 checksum) of the content. This option is ignored if the {@link ZipWriterConstructorOptions#passThrough} option is not set to `true`.
2032
+ *
2033
+ * @deprecated Use {@link ZipWriterAddDataOptions#crc32} instead.
1940
2034
  */
1941
2035
  signature?: number;
1942
2036
  }
@@ -2013,6 +2107,13 @@ export interface ZipWriterConstructorOptions extends WorkerConfiguration {
2013
2107
  keepOrder?: boolean;
2014
2108
  /**
2015
2109
  * The password used to encrypt the content of the entry.
2110
+ *
2111
+ * @remarks
2112
+ * When a password is set and the {@link ZipWriterConstructorOptions#zipCrypto} option is not set to `true`, the
2113
+ * entry is encrypted in AES AE-2 format: the CRC-32 checksum of the content is stored as `0` so that the zip
2114
+ * file reveals no information about the encrypted content. A stored checksum would allow an attacker to verify
2115
+ * guessed content without knowing the password. The integrity of the data is guaranteed by the authentication
2116
+ * code instead.
2016
2117
  */
2017
2118
  password?: string;
2018
2119
  /**
@@ -2057,7 +2158,7 @@ export interface ZipWriterConstructorOptions extends WorkerConfiguration {
2057
2158
  /**
2058
2159
  * `true` to store extended timestamp extra fields.
2059
2160
  *
2060
- * When set to `false`, the maximum last modification date cannot exceed December 31, 2107 and the maximum accuracy is 2 seconds.
2161
+ * When set to `false`, the maximum last modification date cannot exceed December 31, 2107 and the maximum accuracy is 2 seconds, dates being truncated to the whole second and odd seconds rounded up to the next even second.
2061
2162
  *
2062
2163
  * @defaultValue true
2063
2164
  */
@@ -2935,8 +3036,28 @@ export const ERR_RESERVED_COMPRESSION_METHOD: string;
2935
3036
  * Invalid codec module error
2936
3037
  */
2937
3038
  export const ERR_INVALID_CODEC_MODULE: string;
3039
+ /**
3040
+ * Invalid CRC-32 checksum error, thrown when the {@link ZipReaderOptions#checkCrc32} option is set and the CRC-32
3041
+ * checksum of an entry does not match the value stored in the zip file.
3042
+ *
3043
+ * @remarks
3044
+ * This constant and {@link ERR_INVALID_AUTHENTICATION_CODE} share the same value as {@link ERR_INVALID_SIGNATURE}
3045
+ * for backward compatibility. They will become distinct strings in the next minor version.
3046
+ */
3047
+ export const ERR_INVALID_CRC32: string;
3048
+ /**
3049
+ * Invalid authentication code error, thrown when the authentication code of an entry encrypted with AES does not
3050
+ * match the encrypted data, e.g. when the data was tampered or corrupted after the encryption.
3051
+ *
3052
+ * @remarks
3053
+ * This constant and {@link ERR_INVALID_CRC32} share the same value as {@link ERR_INVALID_SIGNATURE} for backward
3054
+ * compatibility. They will become distinct strings in the next minor version.
3055
+ */
3056
+ export const ERR_INVALID_AUTHENTICATION_CODE: string;
2938
3057
  /**
2939
3058
  * Invalid signature error
3059
+ *
3060
+ * @deprecated Use {@link ERR_INVALID_CRC32} or {@link ERR_INVALID_AUTHENTICATION_CODE} instead.
2940
3061
  */
2941
3062
  export const ERR_INVALID_SIGNATURE: string;
2942
3063
  /**
@@ -2954,7 +3075,7 @@ export const ERR_INVALID_UNCOMPRESSED_SIZE: string;
2954
3075
  * native `DecompressionStream` with its own `TypeError` (on Node,
2955
3076
  * `ERR_TRAILING_JUNK_AFTER_STREAM_END`) rather than this error. Any data that is
2956
3077
  * returned is always validated against the entry's uncompressed size (and CRC
2957
- * when `checkSignature` is set), so it is never silently truncated; the backends
3078
+ * when `checkCrc32` is set), so it is never silently truncated; the backends
2958
3079
  * differ only in whether trailing bytes are ignored or raised as an error.
2959
3080
  */
2960
3081
  export const ERR_INVALID_COMPRESSED_DATA: string;
package/index.d.ts CHANGED
@@ -1164,8 +1164,8 @@ export interface ZipReaderOptions {
1164
1164
  * file header of the entry disagrees with its central directory record in a way that could make other tools
1165
1165
  * (e.g. streaming readers based on local file headers) interpret the entry differently. This detects mismatched
1166
1166
  * filenames, general purpose bit flags (encryption, data descriptor and language encoding flags), compression
1167
- * methods, signatures and sizes. The extra fields are not compared because the zip specification allows them
1168
- * to differ.
1167
+ * methods, CRC-32 checksums and sizes. The extra fields are not compared because the zip specification allows
1168
+ * them to differ.
1169
1169
  *
1170
1170
  * @defaultValue false
1171
1171
  */
@@ -1177,7 +1177,24 @@ export interface ZipReaderOptions {
1177
1177
  */
1178
1178
  checkPasswordOnly?: boolean;
1179
1179
  /**
1180
- * `true` to check the signature of the entry.
1180
+ * `true` to verify the CRC-32 checksum of the entry against the value stored in the zip file. The verification
1181
+ * is run on the decompressed data and covers the whole read pipeline. It also applies to entries encrypted with
1182
+ * AES in AE-1 format. It is skipped for entries in AE-2 format because they store a zeroed CRC-32 value.
1183
+ *
1184
+ * @defaultValue false
1185
+ */
1186
+ checkCrc32?: boolean;
1187
+ /**
1188
+ * `true` to verify the authentication code of entries encrypted with AES. The verification detects encrypted
1189
+ * data tampered or corrupted after the encryption.
1190
+ *
1191
+ * @defaultValue true
1192
+ */
1193
+ checkAuthenticationCode?: boolean;
1194
+ /**
1195
+ * `true` to check the CRC-32 checksum of the entry.
1196
+ *
1197
+ * @deprecated Use {@link ZipReaderOptions#checkCrc32} instead.
1181
1198
  *
1182
1199
  * @defaultValue false
1183
1200
  */
@@ -1261,11 +1278,44 @@ export interface EntryExtraFieldAES extends EntryExtraField {
1261
1278
  * The encryption strength (1, 2 or 3).
1262
1279
  */
1263
1280
  strength?: number;
1281
+ /**
1282
+ * The vendor version (1 for AE-1, 2 for AE-2). Entries in AE-1 format store the CRC-32 checksum of the content,
1283
+ * entries in AE-2 format store a zeroed value.
1284
+ */
1285
+ vendorVersion?: number;
1286
+ /**
1287
+ * The vendor identifier.
1288
+ */
1289
+ vendorId?: number;
1264
1290
  /**
1265
1291
  * The compression method stored in the AES extra field.
1266
1292
  */
1267
1293
  originalCompressionMethod?: number;
1268
1294
  }
1295
+ /**
1296
+ * Represents a Unix extra field record storing timestamps: the Info-ZIP Unix type 1 extra field (0x5855),
1297
+ * written notably by macOS Archive Utility and `ditto`, or the PKWARE Unix extra field (0x000d). Both store
1298
+ * the last access/modification dates as 32-bit Unix times, followed by the optional uid/gid in the local
1299
+ * file header.
1300
+ */
1301
+ export interface EntryExtraFieldUnixDates extends EntryExtraField {
1302
+ /**
1303
+ * The last access date.
1304
+ */
1305
+ lastAccessDate?: Date;
1306
+ /**
1307
+ * The last modification date.
1308
+ */
1309
+ lastModDate?: Date;
1310
+ /**
1311
+ * The Unix user id.
1312
+ */
1313
+ uid?: number;
1314
+ /**
1315
+ * The Unix group id.
1316
+ */
1317
+ gid?: number;
1318
+ }
1269
1319
  /**
1270
1320
  * Represents a Unicode path or comment extra field record of an entry.
1271
1321
  */
@@ -1319,8 +1369,14 @@ export interface LocalDirectory {
1319
1369
  * The extra field.
1320
1370
  */
1321
1371
  extraField?: Map<number, EntryExtraField>;
1372
+ /**
1373
+ * The CRC-32 checksum of the content.
1374
+ */
1375
+ crc32?: number;
1322
1376
  /**
1323
1377
  * The signature (CRC32 checksum) of the content.
1378
+ *
1379
+ * @deprecated Use {@link LocalDirectory#crc32} instead.
1324
1380
  */
1325
1381
  signature?: number;
1326
1382
  /**
@@ -1355,6 +1411,14 @@ export interface LocalDirectory {
1355
1411
  * The Info-ZIP Unix extra field.
1356
1412
  */
1357
1413
  extraFieldInfoZip?: EntryExtraField;
1414
+ /**
1415
+ * The Info-ZIP Unix type 1 extra field (0x5855).
1416
+ */
1417
+ extraFieldUnixType1?: EntryExtraFieldUnixDates;
1418
+ /**
1419
+ * The PKWARE Unix extra field (0x000d).
1420
+ */
1421
+ extraFieldPkwareUnix?: EntryExtraFieldUnixDates;
1358
1422
  /**
1359
1423
  * The extended timestamp extra field.
1360
1424
  */
@@ -1462,9 +1526,17 @@ export interface EntryMetaData {
1462
1526
  */
1463
1527
  commentUTF8: boolean;
1464
1528
  /**
1465
- * The signature (CRC32 checksum) of the content.
1529
+ * The CRC-32 checksum of the content. It is `undefined` when the zip file does not store it, e.g. for entries
1530
+ * encrypted with AES in AE-2 format.
1531
+ */
1532
+ crc32?: number;
1533
+ /**
1534
+ * The signature (CRC32 checksum) of the content. It is `undefined` for entries encrypted with AES returned by
1535
+ * {@link ZipWriter#add}.
1536
+ *
1537
+ * @deprecated Use {@link EntryMetaData#crc32} instead.
1466
1538
  */
1467
- signature: number;
1539
+ signature?: number;
1468
1540
  /**
1469
1541
  * The extra field.
1470
1542
  */
@@ -1620,6 +1692,14 @@ export interface EntryMetaData {
1620
1692
  * The Info-ZIP Unix extra field.
1621
1693
  */
1622
1694
  extraFieldInfoZip?: EntryExtraField;
1695
+ /**
1696
+ * The Info-ZIP Unix type 1 extra field (0x5855).
1697
+ */
1698
+ extraFieldUnixType1?: EntryExtraFieldUnixDates;
1699
+ /**
1700
+ * The PKWARE Unix extra field (0x000d).
1701
+ */
1702
+ extraFieldPkwareUnix?: EntryExtraFieldUnixDates;
1623
1703
  /**
1624
1704
  * The extended timestamp extra field.
1625
1705
  */
@@ -1928,15 +2008,29 @@ export interface ZipWriterAddDataOptions
1928
2008
  */
1929
2009
  comment?: string;
1930
2010
  /**
1931
- * The extra field of the entry.
2011
+ * The extra field of the entry, written in the local file header and the central directory.
1932
2012
  */
1933
2013
  extraField?: Map<number, Uint8Array>;
2014
+ /**
2015
+ * The extra field of the entry written only in the local file header.
2016
+ */
2017
+ localExtraField?: Map<number, Uint8Array>;
1934
2018
  /**
1935
2019
  * The uncompressed size of the entry. This option is ignored if the {@link ZipWriterConstructorOptions#passThrough} option is not set to `true`.
1936
2020
  */
1937
2021
  uncompressedSize?: number;
2022
+ /**
2023
+ * The CRC-32 checksum of the content. This option is ignored if the {@link ZipWriterConstructorOptions#passThrough} option is not set to `true`.
2024
+ *
2025
+ * When the entry is AES-encrypted (see {@link ZipWriterConstructorOptions#encrypted}), setting this option marks the entry as AE-1
2026
+ * and stores the checksum in the entry headers, e.g. when copying an AE-1 entry read with the
2027
+ * {@link ZipReaderOptions#passThrough} option. Otherwise, the entry is marked as AE-2 and the checksum fields are set to 0.
2028
+ */
2029
+ crc32?: number;
1938
2030
  /**
1939
2031
  * The signature (CRC32 checksum) of the content. This option is ignored if the {@link ZipWriterConstructorOptions#passThrough} option is not set to `true`.
2032
+ *
2033
+ * @deprecated Use {@link ZipWriterAddDataOptions#crc32} instead.
1940
2034
  */
1941
2035
  signature?: number;
1942
2036
  }
@@ -2013,6 +2107,13 @@ export interface ZipWriterConstructorOptions extends WorkerConfiguration {
2013
2107
  keepOrder?: boolean;
2014
2108
  /**
2015
2109
  * The password used to encrypt the content of the entry.
2110
+ *
2111
+ * @remarks
2112
+ * When a password is set and the {@link ZipWriterConstructorOptions#zipCrypto} option is not set to `true`, the
2113
+ * entry is encrypted in AES AE-2 format: the CRC-32 checksum of the content is stored as `0` so that the zip
2114
+ * file reveals no information about the encrypted content. A stored checksum would allow an attacker to verify
2115
+ * guessed content without knowing the password. The integrity of the data is guaranteed by the authentication
2116
+ * code instead.
2016
2117
  */
2017
2118
  password?: string;
2018
2119
  /**
@@ -2057,7 +2158,7 @@ export interface ZipWriterConstructorOptions extends WorkerConfiguration {
2057
2158
  /**
2058
2159
  * `true` to store extended timestamp extra fields.
2059
2160
  *
2060
- * When set to `false`, the maximum last modification date cannot exceed December 31, 2107 and the maximum accuracy is 2 seconds.
2161
+ * When set to `false`, the maximum last modification date cannot exceed December 31, 2107 and the maximum accuracy is 2 seconds, dates being truncated to the whole second and odd seconds rounded up to the next even second.
2061
2162
  *
2062
2163
  * @defaultValue true
2063
2164
  */
@@ -2935,8 +3036,28 @@ export const ERR_RESERVED_COMPRESSION_METHOD: string;
2935
3036
  * Invalid codec module error
2936
3037
  */
2937
3038
  export const ERR_INVALID_CODEC_MODULE: string;
3039
+ /**
3040
+ * Invalid CRC-32 checksum error, thrown when the {@link ZipReaderOptions#checkCrc32} option is set and the CRC-32
3041
+ * checksum of an entry does not match the value stored in the zip file.
3042
+ *
3043
+ * @remarks
3044
+ * This constant and {@link ERR_INVALID_AUTHENTICATION_CODE} share the same value as {@link ERR_INVALID_SIGNATURE}
3045
+ * for backward compatibility. They will become distinct strings in the next minor version.
3046
+ */
3047
+ export const ERR_INVALID_CRC32: string;
3048
+ /**
3049
+ * Invalid authentication code error, thrown when the authentication code of an entry encrypted with AES does not
3050
+ * match the encrypted data, e.g. when the data was tampered or corrupted after the encryption.
3051
+ *
3052
+ * @remarks
3053
+ * This constant and {@link ERR_INVALID_CRC32} share the same value as {@link ERR_INVALID_SIGNATURE} for backward
3054
+ * compatibility. They will become distinct strings in the next minor version.
3055
+ */
3056
+ export const ERR_INVALID_AUTHENTICATION_CODE: string;
2938
3057
  /**
2939
3058
  * Invalid signature error
3059
+ *
3060
+ * @deprecated Use {@link ERR_INVALID_CRC32} or {@link ERR_INVALID_AUTHENTICATION_CODE} instead.
2940
3061
  */
2941
3062
  export const ERR_INVALID_SIGNATURE: string;
2942
3063
  /**
@@ -2954,7 +3075,7 @@ export const ERR_INVALID_UNCOMPRESSED_SIZE: string;
2954
3075
  * native `DecompressionStream` with its own `TypeError` (on Node,
2955
3076
  * `ERR_TRAILING_JUNK_AFTER_STREAM_END`) rather than this error. Any data that is
2956
3077
  * returned is always validated against the entry's uncompressed size (and CRC
2957
- * when `checkSignature` is set), so it is never silently truncated; the backends
3078
+ * when `checkCrc32` is set), so it is never silently truncated; the backends
2958
3079
  * differ only in whether trailing bytes are ignored or raised as an error.
2959
3080
  */
2960
3081
  export const ERR_INVALID_COMPRESSED_DATA: string;