@yjdyamv/rar-rs 0.17.0 → 0.19.0
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/README.md +14 -0
- package/binding.d.ts +31 -6
- package/binding.js +56 -56
- package/package.json +1 -1
- package/rar-rs-napi.darwin-arm64.node +0 -0
- package/rar-rs-napi.linux-arm-gnueabihf.node +0 -0
- package/rar-rs-napi.linux-arm64-gnu.node +0 -0
- package/rar-rs-napi.linux-arm64-musl.node +0 -0
- package/rar-rs-napi.linux-x64-gnu.node +0 -0
- package/rar-rs-napi.linux-x64-musl.node +0 -0
- package/rar-rs-napi.wasi.d.cts +31 -6
- package/rar-rs-napi.wasm32-wasi.wasm +0 -0
- package/rar-rs-napi.win32-arm64-msvc.node +0 -0
- package/rar-rs-napi.win32-ia32-msvc.node +0 -0
- package/rar-rs-napi.win32-x64-msvc.node +0 -0
package/README.md
CHANGED
|
@@ -174,6 +174,20 @@ either lands or fails); use `extractArchive` when you need progress.
|
|
|
174
174
|
`comment`, `solid`. Sizes and times are JS numbers (bytes / Unix seconds);
|
|
175
175
|
optional fields are `undefined` when the header does not record them.
|
|
176
176
|
|
|
177
|
+
## Passwords
|
|
178
|
+
|
|
179
|
+
Every entry point takes `password` as a plain JS string. The binding copies it
|
|
180
|
+
into a self-wiping buffer (`rar_rs::Password`) at the async boundary and zeroes
|
|
181
|
+
that copy when the task finishes, so the Rust-side lifetime is as short as
|
|
182
|
+
possible. A JavaScript string itself cannot be erased — strings are immutable
|
|
183
|
+
and garbage-collected — and neither can a value that reached the process
|
|
184
|
+
through `ps`; treat the JS-side copy as out of reach and keep it out of logs
|
|
185
|
+
and heap snapshots.
|
|
186
|
+
|
|
187
|
+
Use `encryptHeaders: true` to also hide member names (that is `-hp` in the
|
|
188
|
+
CLI, not a stronger cipher), and `kdfStrength: 15..=24` on create to raise the
|
|
189
|
+
offline-guessing cost above WinRAR's default of 15.
|
|
190
|
+
|
|
177
191
|
## Platforms
|
|
178
192
|
|
|
179
193
|
Native targets: `x86_64`/`i686`/`aarch64` Windows (MSVC), `x86_64`/`aarch64`
|
package/binding.d.ts
CHANGED
|
@@ -17,7 +17,9 @@ export interface AppendArchiveOptions {
|
|
|
17
17
|
level?: number
|
|
18
18
|
/**
|
|
19
19
|
* Password of the existing archive (needed when its content is
|
|
20
|
-
* encrypted so the solid chain can be extended).
|
|
20
|
+
* encrypted so the solid chain can be extended). Copied into a
|
|
21
|
+
* self-wiping buffer for the duration of the task; see
|
|
22
|
+
* [`CreateArchiveOptions::password`].
|
|
21
23
|
*/
|
|
22
24
|
password?: string
|
|
23
25
|
/**
|
|
@@ -25,7 +27,10 @@ export interface AppendArchiveOptions {
|
|
|
25
27
|
* [`CreateArchiveOptions::dict_size`]).
|
|
26
28
|
*/
|
|
27
29
|
dictSize?: string
|
|
28
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* Compression threads for the appended members (any positive count; 0 =
|
|
32
|
+
* automatic; the pool clamps to the host's cores).
|
|
33
|
+
*/
|
|
29
34
|
threadCount?: number
|
|
30
35
|
}
|
|
31
36
|
|
|
@@ -47,10 +52,23 @@ export interface CreateArchiveOptions {
|
|
|
47
52
|
entries: Array<EntryInput>
|
|
48
53
|
/** Compression level 0..=5 (default 3). */
|
|
49
54
|
level?: number
|
|
50
|
-
/**
|
|
55
|
+
/**
|
|
56
|
+
* Optional AES-256 password (file-level encryption).
|
|
57
|
+
*
|
|
58
|
+
* The string is copied into a self-wiping buffer when the task starts, so
|
|
59
|
+
* the Rust-side copy is zeroized when the task finishes. A JS string
|
|
60
|
+
* cannot be erased (immutable, garbage-collected).
|
|
61
|
+
*/
|
|
51
62
|
password?: string
|
|
52
63
|
/** Also encrypt the archive structure (file names). Requires `password`. */
|
|
53
64
|
encryptHeaders?: boolean
|
|
65
|
+
/**
|
|
66
|
+
* KDF strength exponent for every encryption record (`2^strength`
|
|
67
|
+
* chained HMAC-SHA256 iterations). WinRAR writes 15 and exposes no
|
|
68
|
+
* switch; raising it slows offline guessing and costs the same per
|
|
69
|
+
* open. Range 0..=24.
|
|
70
|
+
*/
|
|
71
|
+
kdfStrength?: number
|
|
54
72
|
/**
|
|
55
73
|
* Add a WinRAR-compatible inline recovery record protecting this percent
|
|
56
74
|
* (0-100) of the archive. With `volume_size`, every data volume carries
|
|
@@ -112,7 +130,10 @@ export interface CreateArchiveOptions {
|
|
|
112
130
|
quickOpen?: boolean
|
|
113
131
|
/** Write BLAKE2sp hash records for every member (like WinRAR `-htb`). */
|
|
114
132
|
blake2?: boolean
|
|
115
|
-
/**
|
|
133
|
+
/**
|
|
134
|
+
* Compression threads (any positive count; 0 = automatic). The worker pool
|
|
135
|
+
* clamps to the host's cores.
|
|
136
|
+
*/
|
|
116
137
|
threads?: number
|
|
117
138
|
/**
|
|
118
139
|
* Save the creation time (Windows) / ctime (Unix) in the FILE_TIME
|
|
@@ -254,7 +275,10 @@ export declare function extractArchive(archivePath: string, opts: ExtractArchive
|
|
|
254
275
|
export interface ExtractArchiveOptions {
|
|
255
276
|
/** Destination directory (created when missing). */
|
|
256
277
|
destPath: string
|
|
257
|
-
/**
|
|
278
|
+
/**
|
|
279
|
+
* Password for encrypted archives. Copied into a self-wiping buffer for
|
|
280
|
+
* the duration of the task; see [`CreateArchiveOptions::password`].
|
|
281
|
+
*/
|
|
258
282
|
password?: string
|
|
259
283
|
/** Extract members flat (basename only, no directory tree). */
|
|
260
284
|
flat?: boolean
|
|
@@ -285,7 +309,8 @@ export interface ExtractArchiveOptions {
|
|
|
285
309
|
*/
|
|
286
310
|
update?: boolean
|
|
287
311
|
/**
|
|
288
|
-
* Extraction worker threads for this run (
|
|
312
|
+
* Extraction worker threads for this run (any positive count; 0 =
|
|
313
|
+
* automatic; the pool clamps to the host's cores).
|
|
289
314
|
* Scoped to this call, like `-mt<N>`; falls back to the process-global
|
|
290
315
|
* default when unset.
|
|
291
316
|
*/
|
package/binding.js
CHANGED
|
@@ -94,8 +94,8 @@ function requireNative() {
|
|
|
94
94
|
try {
|
|
95
95
|
const binding = require('@yjdyamv/rar-rs-android-arm64')
|
|
96
96
|
const bindingPackageVersion = require('@yjdyamv/rar-rs-android-arm64/package.json').version
|
|
97
|
-
if (bindingPackageVersion !== '0.
|
|
98
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
97
|
+
if (bindingPackageVersion !== '0.19.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
98
|
+
throw new Error(`Native binding package version mismatch, expected 0.19.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
99
99
|
}
|
|
100
100
|
return binding
|
|
101
101
|
} catch (e) {
|
|
@@ -110,8 +110,8 @@ function requireNative() {
|
|
|
110
110
|
try {
|
|
111
111
|
const binding = require('@yjdyamv/rar-rs-android-arm-eabi')
|
|
112
112
|
const bindingPackageVersion = require('@yjdyamv/rar-rs-android-arm-eabi/package.json').version
|
|
113
|
-
if (bindingPackageVersion !== '0.
|
|
114
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
113
|
+
if (bindingPackageVersion !== '0.19.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
114
|
+
throw new Error(`Native binding package version mismatch, expected 0.19.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
115
115
|
}
|
|
116
116
|
return binding
|
|
117
117
|
} catch (e) {
|
|
@@ -131,8 +131,8 @@ function requireNative() {
|
|
|
131
131
|
try {
|
|
132
132
|
const binding = require('@yjdyamv/rar-rs-win32-x64-gnu')
|
|
133
133
|
const bindingPackageVersion = require('@yjdyamv/rar-rs-win32-x64-gnu/package.json').version
|
|
134
|
-
if (bindingPackageVersion !== '0.
|
|
135
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
134
|
+
if (bindingPackageVersion !== '0.19.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
135
|
+
throw new Error(`Native binding package version mismatch, expected 0.19.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
136
136
|
}
|
|
137
137
|
return binding
|
|
138
138
|
} catch (e) {
|
|
@@ -147,8 +147,8 @@ function requireNative() {
|
|
|
147
147
|
try {
|
|
148
148
|
const binding = require('@yjdyamv/rar-rs-win32-x64-msvc')
|
|
149
149
|
const bindingPackageVersion = require('@yjdyamv/rar-rs-win32-x64-msvc/package.json').version
|
|
150
|
-
if (bindingPackageVersion !== '0.
|
|
151
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
150
|
+
if (bindingPackageVersion !== '0.19.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
151
|
+
throw new Error(`Native binding package version mismatch, expected 0.19.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
152
152
|
}
|
|
153
153
|
return binding
|
|
154
154
|
} catch (e) {
|
|
@@ -164,8 +164,8 @@ function requireNative() {
|
|
|
164
164
|
try {
|
|
165
165
|
const binding = require('@yjdyamv/rar-rs-win32-ia32-msvc')
|
|
166
166
|
const bindingPackageVersion = require('@yjdyamv/rar-rs-win32-ia32-msvc/package.json').version
|
|
167
|
-
if (bindingPackageVersion !== '0.
|
|
168
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
167
|
+
if (bindingPackageVersion !== '0.19.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
168
|
+
throw new Error(`Native binding package version mismatch, expected 0.19.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
169
169
|
}
|
|
170
170
|
return binding
|
|
171
171
|
} catch (e) {
|
|
@@ -180,8 +180,8 @@ function requireNative() {
|
|
|
180
180
|
try {
|
|
181
181
|
const binding = require('@yjdyamv/rar-rs-win32-arm64-msvc')
|
|
182
182
|
const bindingPackageVersion = require('@yjdyamv/rar-rs-win32-arm64-msvc/package.json').version
|
|
183
|
-
if (bindingPackageVersion !== '0.
|
|
184
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
183
|
+
if (bindingPackageVersion !== '0.19.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
184
|
+
throw new Error(`Native binding package version mismatch, expected 0.19.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
185
185
|
}
|
|
186
186
|
return binding
|
|
187
187
|
} catch (e) {
|
|
@@ -199,8 +199,8 @@ function requireNative() {
|
|
|
199
199
|
try {
|
|
200
200
|
const binding = require('@yjdyamv/rar-rs-darwin-universal')
|
|
201
201
|
const bindingPackageVersion = require('@yjdyamv/rar-rs-darwin-universal/package.json').version
|
|
202
|
-
if (bindingPackageVersion !== '0.
|
|
203
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
202
|
+
if (bindingPackageVersion !== '0.19.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
203
|
+
throw new Error(`Native binding package version mismatch, expected 0.19.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
204
204
|
}
|
|
205
205
|
return binding
|
|
206
206
|
} catch (e) {
|
|
@@ -215,8 +215,8 @@ function requireNative() {
|
|
|
215
215
|
try {
|
|
216
216
|
const binding = require('@yjdyamv/rar-rs-darwin-x64')
|
|
217
217
|
const bindingPackageVersion = require('@yjdyamv/rar-rs-darwin-x64/package.json').version
|
|
218
|
-
if (bindingPackageVersion !== '0.
|
|
219
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
218
|
+
if (bindingPackageVersion !== '0.19.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
219
|
+
throw new Error(`Native binding package version mismatch, expected 0.19.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
220
220
|
}
|
|
221
221
|
return binding
|
|
222
222
|
} catch (e) {
|
|
@@ -231,8 +231,8 @@ function requireNative() {
|
|
|
231
231
|
try {
|
|
232
232
|
const binding = require('@yjdyamv/rar-rs-darwin-arm64')
|
|
233
233
|
const bindingPackageVersion = require('@yjdyamv/rar-rs-darwin-arm64/package.json').version
|
|
234
|
-
if (bindingPackageVersion !== '0.
|
|
235
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
234
|
+
if (bindingPackageVersion !== '0.19.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
235
|
+
throw new Error(`Native binding package version mismatch, expected 0.19.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
236
236
|
}
|
|
237
237
|
return binding
|
|
238
238
|
} catch (e) {
|
|
@@ -251,8 +251,8 @@ function requireNative() {
|
|
|
251
251
|
try {
|
|
252
252
|
const binding = require('@yjdyamv/rar-rs-freebsd-x64')
|
|
253
253
|
const bindingPackageVersion = require('@yjdyamv/rar-rs-freebsd-x64/package.json').version
|
|
254
|
-
if (bindingPackageVersion !== '0.
|
|
255
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
254
|
+
if (bindingPackageVersion !== '0.19.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
255
|
+
throw new Error(`Native binding package version mismatch, expected 0.19.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
256
256
|
}
|
|
257
257
|
return binding
|
|
258
258
|
} catch (e) {
|
|
@@ -267,8 +267,8 @@ function requireNative() {
|
|
|
267
267
|
try {
|
|
268
268
|
const binding = require('@yjdyamv/rar-rs-freebsd-arm64')
|
|
269
269
|
const bindingPackageVersion = require('@yjdyamv/rar-rs-freebsd-arm64/package.json').version
|
|
270
|
-
if (bindingPackageVersion !== '0.
|
|
271
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
270
|
+
if (bindingPackageVersion !== '0.19.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
271
|
+
throw new Error(`Native binding package version mismatch, expected 0.19.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
272
272
|
}
|
|
273
273
|
return binding
|
|
274
274
|
} catch (e) {
|
|
@@ -283,8 +283,8 @@ function requireNative() {
|
|
|
283
283
|
try {
|
|
284
284
|
const binding = require('@yjdyamv/rar-rs-freebsd-ppc64')
|
|
285
285
|
const bindingPackageVersion = require('@yjdyamv/rar-rs-freebsd-ppc64/package.json').version
|
|
286
|
-
if (bindingPackageVersion !== '0.
|
|
287
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
286
|
+
if (bindingPackageVersion !== '0.19.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
287
|
+
throw new Error(`Native binding package version mismatch, expected 0.19.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
288
288
|
}
|
|
289
289
|
return binding
|
|
290
290
|
} catch (e) {
|
|
@@ -304,8 +304,8 @@ function requireNative() {
|
|
|
304
304
|
try {
|
|
305
305
|
const binding = require('@yjdyamv/rar-rs-linux-x64-musl')
|
|
306
306
|
const bindingPackageVersion = require('@yjdyamv/rar-rs-linux-x64-musl/package.json').version
|
|
307
|
-
if (bindingPackageVersion !== '0.
|
|
308
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
307
|
+
if (bindingPackageVersion !== '0.19.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
308
|
+
throw new Error(`Native binding package version mismatch, expected 0.19.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
309
309
|
}
|
|
310
310
|
return binding
|
|
311
311
|
} catch (e) {
|
|
@@ -320,8 +320,8 @@ function requireNative() {
|
|
|
320
320
|
try {
|
|
321
321
|
const binding = require('@yjdyamv/rar-rs-linux-x64-gnu')
|
|
322
322
|
const bindingPackageVersion = require('@yjdyamv/rar-rs-linux-x64-gnu/package.json').version
|
|
323
|
-
if (bindingPackageVersion !== '0.
|
|
324
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
323
|
+
if (bindingPackageVersion !== '0.19.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
324
|
+
throw new Error(`Native binding package version mismatch, expected 0.19.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
325
325
|
}
|
|
326
326
|
return binding
|
|
327
327
|
} catch (e) {
|
|
@@ -338,8 +338,8 @@ function requireNative() {
|
|
|
338
338
|
try {
|
|
339
339
|
const binding = require('@yjdyamv/rar-rs-linux-arm64-musl')
|
|
340
340
|
const bindingPackageVersion = require('@yjdyamv/rar-rs-linux-arm64-musl/package.json').version
|
|
341
|
-
if (bindingPackageVersion !== '0.
|
|
342
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
341
|
+
if (bindingPackageVersion !== '0.19.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
342
|
+
throw new Error(`Native binding package version mismatch, expected 0.19.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
343
343
|
}
|
|
344
344
|
return binding
|
|
345
345
|
} catch (e) {
|
|
@@ -354,8 +354,8 @@ function requireNative() {
|
|
|
354
354
|
try {
|
|
355
355
|
const binding = require('@yjdyamv/rar-rs-linux-arm64-gnu')
|
|
356
356
|
const bindingPackageVersion = require('@yjdyamv/rar-rs-linux-arm64-gnu/package.json').version
|
|
357
|
-
if (bindingPackageVersion !== '0.
|
|
358
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
357
|
+
if (bindingPackageVersion !== '0.19.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
358
|
+
throw new Error(`Native binding package version mismatch, expected 0.19.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
359
359
|
}
|
|
360
360
|
return binding
|
|
361
361
|
} catch (e) {
|
|
@@ -372,8 +372,8 @@ function requireNative() {
|
|
|
372
372
|
try {
|
|
373
373
|
const binding = require('@yjdyamv/rar-rs-linux-arm-musleabihf')
|
|
374
374
|
const bindingPackageVersion = require('@yjdyamv/rar-rs-linux-arm-musleabihf/package.json').version
|
|
375
|
-
if (bindingPackageVersion !== '0.
|
|
376
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
375
|
+
if (bindingPackageVersion !== '0.19.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
376
|
+
throw new Error(`Native binding package version mismatch, expected 0.19.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
377
377
|
}
|
|
378
378
|
return binding
|
|
379
379
|
} catch (e) {
|
|
@@ -388,8 +388,8 @@ function requireNative() {
|
|
|
388
388
|
try {
|
|
389
389
|
const binding = require('@yjdyamv/rar-rs-linux-arm-gnueabihf')
|
|
390
390
|
const bindingPackageVersion = require('@yjdyamv/rar-rs-linux-arm-gnueabihf/package.json').version
|
|
391
|
-
if (bindingPackageVersion !== '0.
|
|
392
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
391
|
+
if (bindingPackageVersion !== '0.19.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
392
|
+
throw new Error(`Native binding package version mismatch, expected 0.19.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
393
393
|
}
|
|
394
394
|
return binding
|
|
395
395
|
} catch (e) {
|
|
@@ -406,8 +406,8 @@ function requireNative() {
|
|
|
406
406
|
try {
|
|
407
407
|
const binding = require('@yjdyamv/rar-rs-linux-loong64-musl')
|
|
408
408
|
const bindingPackageVersion = require('@yjdyamv/rar-rs-linux-loong64-musl/package.json').version
|
|
409
|
-
if (bindingPackageVersion !== '0.
|
|
410
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
409
|
+
if (bindingPackageVersion !== '0.19.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
410
|
+
throw new Error(`Native binding package version mismatch, expected 0.19.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
411
411
|
}
|
|
412
412
|
return binding
|
|
413
413
|
} catch (e) {
|
|
@@ -422,8 +422,8 @@ function requireNative() {
|
|
|
422
422
|
try {
|
|
423
423
|
const binding = require('@yjdyamv/rar-rs-linux-loong64-gnu')
|
|
424
424
|
const bindingPackageVersion = require('@yjdyamv/rar-rs-linux-loong64-gnu/package.json').version
|
|
425
|
-
if (bindingPackageVersion !== '0.
|
|
426
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
425
|
+
if (bindingPackageVersion !== '0.19.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
426
|
+
throw new Error(`Native binding package version mismatch, expected 0.19.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
427
427
|
}
|
|
428
428
|
return binding
|
|
429
429
|
} catch (e) {
|
|
@@ -440,8 +440,8 @@ function requireNative() {
|
|
|
440
440
|
try {
|
|
441
441
|
const binding = require('@yjdyamv/rar-rs-linux-riscv64-musl')
|
|
442
442
|
const bindingPackageVersion = require('@yjdyamv/rar-rs-linux-riscv64-musl/package.json').version
|
|
443
|
-
if (bindingPackageVersion !== '0.
|
|
444
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
443
|
+
if (bindingPackageVersion !== '0.19.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
444
|
+
throw new Error(`Native binding package version mismatch, expected 0.19.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
445
445
|
}
|
|
446
446
|
return binding
|
|
447
447
|
} catch (e) {
|
|
@@ -456,8 +456,8 @@ function requireNative() {
|
|
|
456
456
|
try {
|
|
457
457
|
const binding = require('@yjdyamv/rar-rs-linux-riscv64-gnu')
|
|
458
458
|
const bindingPackageVersion = require('@yjdyamv/rar-rs-linux-riscv64-gnu/package.json').version
|
|
459
|
-
if (bindingPackageVersion !== '0.
|
|
460
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
459
|
+
if (bindingPackageVersion !== '0.19.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
460
|
+
throw new Error(`Native binding package version mismatch, expected 0.19.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
461
461
|
}
|
|
462
462
|
return binding
|
|
463
463
|
} catch (e) {
|
|
@@ -473,8 +473,8 @@ function requireNative() {
|
|
|
473
473
|
try {
|
|
474
474
|
const binding = require('@yjdyamv/rar-rs-linux-ppc64-gnu')
|
|
475
475
|
const bindingPackageVersion = require('@yjdyamv/rar-rs-linux-ppc64-gnu/package.json').version
|
|
476
|
-
if (bindingPackageVersion !== '0.
|
|
477
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
476
|
+
if (bindingPackageVersion !== '0.19.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
477
|
+
throw new Error(`Native binding package version mismatch, expected 0.19.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
478
478
|
}
|
|
479
479
|
return binding
|
|
480
480
|
} catch (e) {
|
|
@@ -489,8 +489,8 @@ function requireNative() {
|
|
|
489
489
|
try {
|
|
490
490
|
const binding = require('@yjdyamv/rar-rs-linux-s390x-gnu')
|
|
491
491
|
const bindingPackageVersion = require('@yjdyamv/rar-rs-linux-s390x-gnu/package.json').version
|
|
492
|
-
if (bindingPackageVersion !== '0.
|
|
493
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
492
|
+
if (bindingPackageVersion !== '0.19.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
493
|
+
throw new Error(`Native binding package version mismatch, expected 0.19.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
494
494
|
}
|
|
495
495
|
return binding
|
|
496
496
|
} catch (e) {
|
|
@@ -509,8 +509,8 @@ function requireNative() {
|
|
|
509
509
|
try {
|
|
510
510
|
const binding = require('@yjdyamv/rar-rs-openharmony-arm64')
|
|
511
511
|
const bindingPackageVersion = require('@yjdyamv/rar-rs-openharmony-arm64/package.json').version
|
|
512
|
-
if (bindingPackageVersion !== '0.
|
|
513
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
512
|
+
if (bindingPackageVersion !== '0.19.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
513
|
+
throw new Error(`Native binding package version mismatch, expected 0.19.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
514
514
|
}
|
|
515
515
|
return binding
|
|
516
516
|
} catch (e) {
|
|
@@ -525,8 +525,8 @@ function requireNative() {
|
|
|
525
525
|
try {
|
|
526
526
|
const binding = require('@yjdyamv/rar-rs-openharmony-x64')
|
|
527
527
|
const bindingPackageVersion = require('@yjdyamv/rar-rs-openharmony-x64/package.json').version
|
|
528
|
-
if (bindingPackageVersion !== '0.
|
|
529
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
528
|
+
if (bindingPackageVersion !== '0.19.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
529
|
+
throw new Error(`Native binding package version mismatch, expected 0.19.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
530
530
|
}
|
|
531
531
|
return binding
|
|
532
532
|
} catch (e) {
|
|
@@ -541,8 +541,8 @@ function requireNative() {
|
|
|
541
541
|
try {
|
|
542
542
|
const binding = require('@yjdyamv/rar-rs-openharmony-arm')
|
|
543
543
|
const bindingPackageVersion = require('@yjdyamv/rar-rs-openharmony-arm/package.json').version
|
|
544
|
-
if (bindingPackageVersion !== '0.
|
|
545
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
544
|
+
if (bindingPackageVersion !== '0.19.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
545
|
+
throw new Error(`Native binding package version mismatch, expected 0.19.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
546
546
|
}
|
|
547
547
|
return binding
|
|
548
548
|
} catch (e) {
|
|
@@ -683,8 +683,8 @@ if (!nativeBinding || forceWasi) {
|
|
|
683
683
|
if (!candidateFailed) {
|
|
684
684
|
if (process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
685
685
|
const bindingPackageVersion = require('@yjdyamv/rar-rs-wasm32-wasi/package.json').version
|
|
686
|
-
if (bindingPackageVersion !== '0.
|
|
687
|
-
throw new Error(`WASI binding package version mismatch, expected 0.
|
|
686
|
+
if (bindingPackageVersion !== '0.19.0') {
|
|
687
|
+
throw new Error(`WASI binding package version mismatch, expected 0.19.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
688
688
|
}
|
|
689
689
|
}
|
|
690
690
|
wasiBinding = require('@yjdyamv/rar-rs-wasm32-wasi')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yjdyamv/rar-rs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"description": "Pure-Rust RAR archive toolkit for Node.js — create, read, extract, test, modify and repair RAR5/RAR7 and legacy RAR 1.3–4.x archives, with no external rar/unrar binary",
|
|
5
5
|
"license": "BSD-2-Clause",
|
|
6
6
|
"main": "rar-rs.js",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/rar-rs-napi.wasi.d.cts
CHANGED
|
@@ -12,7 +12,9 @@ export interface AppendArchiveOptions {
|
|
|
12
12
|
level?: number
|
|
13
13
|
/**
|
|
14
14
|
* Password of the existing archive (needed when its content is
|
|
15
|
-
* encrypted so the solid chain can be extended).
|
|
15
|
+
* encrypted so the solid chain can be extended). Copied into a
|
|
16
|
+
* self-wiping buffer for the duration of the task; see
|
|
17
|
+
* [`CreateArchiveOptions::password`].
|
|
16
18
|
*/
|
|
17
19
|
password?: string
|
|
18
20
|
/**
|
|
@@ -20,7 +22,10 @@ export interface AppendArchiveOptions {
|
|
|
20
22
|
* [`CreateArchiveOptions::dict_size`]).
|
|
21
23
|
*/
|
|
22
24
|
dictSize?: string
|
|
23
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Compression threads for the appended members (any positive count; 0 =
|
|
27
|
+
* automatic; the pool clamps to the host's cores).
|
|
28
|
+
*/
|
|
24
29
|
threadCount?: number
|
|
25
30
|
}
|
|
26
31
|
|
|
@@ -42,10 +47,23 @@ export interface CreateArchiveOptions {
|
|
|
42
47
|
entries: Array<EntryInput>
|
|
43
48
|
/** Compression level 0..=5 (default 3). */
|
|
44
49
|
level?: number
|
|
45
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* Optional AES-256 password (file-level encryption).
|
|
52
|
+
*
|
|
53
|
+
* The string is copied into a self-wiping buffer when the task starts, so
|
|
54
|
+
* the Rust-side copy is zeroized when the task finishes. A JS string
|
|
55
|
+
* cannot be erased (immutable, garbage-collected).
|
|
56
|
+
*/
|
|
46
57
|
password?: string
|
|
47
58
|
/** Also encrypt the archive structure (file names). Requires `password`. */
|
|
48
59
|
encryptHeaders?: boolean
|
|
60
|
+
/**
|
|
61
|
+
* KDF strength exponent for every encryption record (`2^strength`
|
|
62
|
+
* chained HMAC-SHA256 iterations). WinRAR writes 15 and exposes no
|
|
63
|
+
* switch; raising it slows offline guessing and costs the same per
|
|
64
|
+
* open. Range 0..=24.
|
|
65
|
+
*/
|
|
66
|
+
kdfStrength?: number
|
|
49
67
|
/**
|
|
50
68
|
* Add a WinRAR-compatible inline recovery record protecting this percent
|
|
51
69
|
* (0-100) of the archive. With `volume_size`, every data volume carries
|
|
@@ -107,7 +125,10 @@ export interface CreateArchiveOptions {
|
|
|
107
125
|
quickOpen?: boolean
|
|
108
126
|
/** Write BLAKE2sp hash records for every member (like WinRAR `-htb`). */
|
|
109
127
|
blake2?: boolean
|
|
110
|
-
/**
|
|
128
|
+
/**
|
|
129
|
+
* Compression threads (any positive count; 0 = automatic). The worker pool
|
|
130
|
+
* clamps to the host's cores.
|
|
131
|
+
*/
|
|
111
132
|
threads?: number
|
|
112
133
|
/**
|
|
113
134
|
* Save the creation time (Windows) / ctime (Unix) in the FILE_TIME
|
|
@@ -249,7 +270,10 @@ export declare function extractArchive(archivePath: string, opts: ExtractArchive
|
|
|
249
270
|
export interface ExtractArchiveOptions {
|
|
250
271
|
/** Destination directory (created when missing). */
|
|
251
272
|
destPath: string
|
|
252
|
-
/**
|
|
273
|
+
/**
|
|
274
|
+
* Password for encrypted archives. Copied into a self-wiping buffer for
|
|
275
|
+
* the duration of the task; see [`CreateArchiveOptions::password`].
|
|
276
|
+
*/
|
|
253
277
|
password?: string
|
|
254
278
|
/** Extract members flat (basename only, no directory tree). */
|
|
255
279
|
flat?: boolean
|
|
@@ -280,7 +304,8 @@ export interface ExtractArchiveOptions {
|
|
|
280
304
|
*/
|
|
281
305
|
update?: boolean
|
|
282
306
|
/**
|
|
283
|
-
* Extraction worker threads for this run (
|
|
307
|
+
* Extraction worker threads for this run (any positive count; 0 =
|
|
308
|
+
* automatic; the pool clamps to the host's cores).
|
|
284
309
|
* Scoped to this call, like `-mt<N>`; falls back to the process-global
|
|
285
310
|
* default when unset.
|
|
286
311
|
*/
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|