xypriss-security 2.0.9 → 2.1.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.
Files changed (34) hide show
  1. package/README.md +10 -8
  2. package/dist/src/components/index.d.ts +1 -1
  3. package/dist/src/components/index.js +1 -1
  4. package/dist/src/core/PasswordManager.d.ts +205 -0
  5. package/dist/src/core/PasswordManager.d.ts.map +1 -0
  6. package/dist/src/core/PasswordManager.js +478 -0
  7. package/dist/src/core/PasswordManager.js.map +1 -0
  8. package/dist/src/core/SecureBuffer.d.ts +1 -1
  9. package/dist/src/core/SecureBuffer.js +1 -1
  10. package/dist/src/core/index.d.ts +3 -2
  11. package/dist/src/core/index.d.ts.map +1 -1
  12. package/dist/src/core/index.js +4 -3
  13. package/dist/src/core/index.js.map +1 -1
  14. package/dist/src/index.d.ts +3 -3
  15. package/dist/src/index.d.ts.map +1 -1
  16. package/dist/src/index.js +9 -5
  17. package/dist/src/index.js.map +1 -1
  18. package/dist/src/mods/PasswordMDict.d.ts +141 -0
  19. package/dist/src/mods/PasswordMDict.d.ts.map +1 -0
  20. package/dist/src/mods/PasswordMDict.js +434 -0
  21. package/dist/src/mods/PasswordMDict.js.map +1 -0
  22. package/dist/src/mods/eff_large_wordlist.txt +7776 -0
  23. package/dist/src/mods/eff_short_wordlist_2_0.txt +1296 -0
  24. package/dist/src/types/PasswordManagerOptions.d.ts +142 -0
  25. package/dist/src/types/PasswordManagerOptions.d.ts.map +1 -0
  26. package/dist/src/types/PasswordManagerOptions.js +4 -0
  27. package/dist/src/types/PasswordManagerOptions.js.map +1 -0
  28. package/dist/src/types/index.d.ts +1 -1
  29. package/dist/src/types/index.js +1 -1
  30. package/dist/src/utils/CryptoAlgorithmUtils.d.ts +1 -1
  31. package/dist/src/utils/CryptoAlgorithmUtils.js +1 -1
  32. package/dist/src/utils/index.d.ts +1 -1
  33. package/dist/src/utils/index.js +1 -1
  34. package/package.json +2 -2
@@ -0,0 +1,141 @@
1
+ /***************************************************************************
2
+ * XyPriss Security - Advanced Hyper-Modular Security Framework
3
+ *
4
+ * @author NEHONIX (Nehonix-Team - https://github.com/Nehonix-Team)
5
+ * @license Nehonix Open Source License (NOSL)
6
+ *
7
+ * Copyright (c) 2025 NEHONIX. All rights reserved.
8
+ ****************************************************************************/
9
+ export declare const CHARSETS: {
10
+ readonly uppercase: "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
11
+ readonly lowercase: "abcdefghijklmnopqrstuvwxyz";
12
+ readonly numbers: "0123456789";
13
+ readonly symbols: "!@#$%^&*()_+-=[]{}|;:,.<>?";
14
+ readonly similarChars: RegExp;
15
+ };
16
+ /** Minimum length enforced on every `generate()` call. */
17
+ export declare const MIN_GENERATE_LENGTH = 8;
18
+ /** Maximum length enforced on every `generate()` call. */
19
+ export declare const MAX_GENERATE_LENGTH = 512;
20
+ /**
21
+ * Supported EFF wordlist variants.
22
+ *
23
+ * | Variant | Dice | Words | Entropy/word |
24
+ * |--------------|------|-------|--------------|
25
+ * | `large` | 5×d6 | 7 776 | ~12.9 bits |
26
+ * | `short1` | 4×d6 | 1 296 | ~10.3 bits |
27
+ * | `short2` | 4×d6 | 1 296 | ~10.3 bits |
28
+ */
29
+ export type EFFWordlistVariant = "large" | "short1" | "short2";
30
+ /**
31
+ * Canonical filenames used by the EFF for each wordlist variant.
32
+ * Match the files available at:
33
+ * https://www.eff.org/files/2016/07/18/eff_large_wordlist.txt
34
+ * https://www.eff.org/files/2016/09/08/eff_short_wordlist_1.txt
35
+ * https://www.eff.org/files/2016/09/08/eff_short_wordlist_2_0.txt
36
+ */
37
+ export declare const EFF_FILENAMES: Record<EFFWordlistVariant, string>;
38
+ /**
39
+ * Options for `loadEFFWordlist`.
40
+ */
41
+ export interface LoadWordlistOptions {
42
+ /**
43
+ * Directory that contains the EFF `.txt` files.
44
+ * Resolved relative to `process.cwd()` if not absolute.
45
+ * @default process.cwd()
46
+ */
47
+ dir?: string;
48
+ /**
49
+ * Wordlist variant to load.
50
+ * @default "large"
51
+ */
52
+ variant?: EFFWordlistVariant;
53
+ /**
54
+ * Custom file path, taking precedence over `dir` + `variant`.
55
+ * Use this to load any EFF-formatted wordlist from an arbitrary location.
56
+ */
57
+ filePath?: string;
58
+ }
59
+ /**
60
+ * Parses a raw EFF `.txt` wordlist file and returns a deduplicated,
61
+ * validated `readonly string[]` ready for use in `generatePassphrase()`.
62
+ *
63
+ * **Supported line formats (both are handled automatically):**
64
+ * ```
65
+ * # Numbered (dice-index prefix, tab-separated):
66
+ * 11111\tabacus
67
+ * 11112\tabrupt
68
+ *
69
+ * # Plain (one word per line):
70
+ * abacus
71
+ * abrupt
72
+ * ```
73
+ *
74
+ * Lines that are empty, start with `#`, or produce a word of length < 2
75
+ * after stripping are silently ignored.
76
+ *
77
+ * @param options - File location and variant configuration.
78
+ * @returns A readonly array of lowercased, trimmed words.
79
+ * @throws `Error` if the file cannot be read or yields fewer than 10 words.
80
+ *
81
+ * @example
82
+ * // Load from ./wordlists/eff_large_wordlist.txt
83
+ * const words = loadEFFWordlist({ dir: "./wordlists", variant: "large" });
84
+ *
85
+ * @example
86
+ * // Load a custom EFF-format file
87
+ * const words = loadEFFWordlist({ filePath: "/opt/security/my_words.txt" });
88
+ */
89
+ export declare function loadEFFWordlist(options?: LoadWordlistOptions): readonly string[];
90
+ /**
91
+ * Compact built-in fallback wordlist (256 words).
92
+ *
93
+ * This is used by `getWordlist()` when no external file is provided and
94
+ * `allowFallback` is `true`. It satisfies the EFF's criteria of being
95
+ * unambiguous, easy to spell, and free of visually confusable entries.
96
+ *
97
+ * **Do not import this array directly for production passphrases** — use
98
+ * `getWordlist()` instead, which will prefer a full EFF file when available.
99
+ */
100
+ export declare const FALLBACK_WORDLIST: readonly string[];
101
+ /**
102
+ * Options for `getWordlist`.
103
+ */
104
+ export interface GetWordlistOptions extends LoadWordlistOptions {
105
+ /**
106
+ * Whether to fall back to the built-in 256-word list if the external
107
+ * file cannot be loaded.
108
+ *
109
+ * - `"silent"` — fall back without any output.
110
+ * - `"warn"` — print a `console.warn` before falling back.
111
+ * - `false` — rethrow the file load error (no fallback).
112
+ *
113
+ * @default "warn"
114
+ */
115
+ allowFallback?: "silent" | "warn" | false;
116
+ }
117
+ /**
118
+ * Unified wordlist accessor: tries to load an EFF file, falls back to the
119
+ * built-in list according to `allowFallback`.
120
+ *
121
+ * Use this function in `PasswordManager.generatePassphrase()` to stay
122
+ * decoupled from both the file system and the hardcoded list.
123
+ *
124
+ * @param options - File location, variant, and fallback policy.
125
+ * @returns A readonly array of words suitable for passphrase generation.
126
+ *
127
+ * @example
128
+ * // Prefer the large EFF list; warn & fall back if absent
129
+ * const words = getWordlist({ dir: "./assets/wordlists", variant: "large" });
130
+ *
131
+ * @example
132
+ * // Never fall back — throw if the file is missing
133
+ * const words = getWordlist({ filePath: "./eff_large_wordlist.txt", allowFallback: false });
134
+ *
135
+ * @example
136
+ * // Only use the built-in list (no file needed)
137
+ * const words = getWordlist({ allowFallback: "silent" });
138
+ * // → returns FALLBACK_WORDLIST without attempting any file read
139
+ */
140
+ export declare function getWordlist(options?: GetWordlistOptions): readonly string[];
141
+ //# sourceMappingURL=PasswordMDict.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PasswordMDict.d.ts","sourceRoot":"","sources":["../../../src/mods/PasswordMDict.ts"],"names":[],"mappings":"AAAA;;;;;;;8EAO8E;AAO9E,eAAO,MAAM,QAAQ;;;;;;CAMX,CAAC;AAEX,0DAA0D;AAC1D,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,0DAA0D;AAC1D,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAIvC;;;;;;;;GAQG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE/D;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAI5D,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAE7B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,eAAe,CAC7B,OAAO,GAAE,mBAAwB,GAChC,SAAS,MAAM,EAAE,CA4DnB;AAID;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,MAAM,EA6P7C,CAAC;AAIH;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,mBAAmB;IAC7D;;;;;;;;;OASG;IACH,aAAa,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAC;CAC3C;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,WAAW,CACzB,OAAO,GAAE,kBAAuB,GAC/B,SAAS,MAAM,EAAE,CA8BnB"}
@@ -0,0 +1,434 @@
1
+ "use strict";
2
+ /***************************************************************************
3
+ * XyPriss Security - Advanced Hyper-Modular Security Framework
4
+ *
5
+ * @author NEHONIX (Nehonix-Team - https://github.com/Nehonix-Team)
6
+ * @license Nehonix Open Source License (NOSL)
7
+ *
8
+ * Copyright (c) 2025 NEHONIX. All rights reserved.
9
+ ****************************************************************************/
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.FALLBACK_WORDLIST = exports.EFF_FILENAMES = exports.MAX_GENERATE_LENGTH = exports.MIN_GENERATE_LENGTH = exports.CHARSETS = void 0;
12
+ exports.loadEFFWordlist = loadEFFWordlist;
13
+ exports.getWordlist = getWordlist;
14
+ const fs_1 = require("fs");
15
+ const path_1 = require("path");
16
+ // ─── Character Sets ───────────────────────────────────────────────────────────
17
+ exports.CHARSETS = {
18
+ uppercase: "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
19
+ lowercase: "abcdefghijklmnopqrstuvwxyz",
20
+ numbers: "0123456789",
21
+ symbols: "!@#$%^&*()_+-=[]{}|;:,.<>?",
22
+ similarChars: /[0O1lI|]/g,
23
+ };
24
+ /** Minimum length enforced on every `generate()` call. */
25
+ exports.MIN_GENERATE_LENGTH = 8;
26
+ /** Maximum length enforced on every `generate()` call. */
27
+ exports.MAX_GENERATE_LENGTH = 512;
28
+ /**
29
+ * Canonical filenames used by the EFF for each wordlist variant.
30
+ * Match the files available at:
31
+ * https://www.eff.org/files/2016/07/18/eff_large_wordlist.txt
32
+ * https://www.eff.org/files/2016/09/08/eff_short_wordlist_1.txt
33
+ * https://www.eff.org/files/2016/09/08/eff_short_wordlist_2_0.txt
34
+ */
35
+ exports.EFF_FILENAMES = {
36
+ large: "eff_large_wordlist.txt",
37
+ short1: "eff_short_wordlist_1.txt",
38
+ short2: "eff_short_wordlist_2_0.txt",
39
+ };
40
+ /**
41
+ * Parses a raw EFF `.txt` wordlist file and returns a deduplicated,
42
+ * validated `readonly string[]` ready for use in `generatePassphrase()`.
43
+ *
44
+ * **Supported line formats (both are handled automatically):**
45
+ * ```
46
+ * # Numbered (dice-index prefix, tab-separated):
47
+ * 11111\tabacus
48
+ * 11112\tabrupt
49
+ *
50
+ * # Plain (one word per line):
51
+ * abacus
52
+ * abrupt
53
+ * ```
54
+ *
55
+ * Lines that are empty, start with `#`, or produce a word of length < 2
56
+ * after stripping are silently ignored.
57
+ *
58
+ * @param options - File location and variant configuration.
59
+ * @returns A readonly array of lowercased, trimmed words.
60
+ * @throws `Error` if the file cannot be read or yields fewer than 10 words.
61
+ *
62
+ * @example
63
+ * // Load from ./wordlists/eff_large_wordlist.txt
64
+ * const words = loadEFFWordlist({ dir: "./wordlists", variant: "large" });
65
+ *
66
+ * @example
67
+ * // Load a custom EFF-format file
68
+ * const words = loadEFFWordlist({ filePath: "/opt/security/my_words.txt" });
69
+ */
70
+ function loadEFFWordlist(options = {}) {
71
+ const { dir, variant = "large", filePath } = options;
72
+ // ── Resolve path ────────────────────────────────────────────────────────────
73
+ let absolutePath;
74
+ if (filePath) {
75
+ absolutePath = (0, path_1.resolve)(filePath);
76
+ }
77
+ else {
78
+ const baseDir = dir ? (0, path_1.resolve)(dir) : process.cwd();
79
+ absolutePath = (0, path_1.resolve)(baseDir, exports.EFF_FILENAMES[variant]);
80
+ }
81
+ // ── Read file ───────────────────────────────────────────────────────────────
82
+ let raw;
83
+ try {
84
+ raw = (0, fs_1.readFileSync)(absolutePath, "utf-8");
85
+ }
86
+ catch (err) {
87
+ const msg = err instanceof Error ? err.message : String(err);
88
+ throw new Error(`loadEFFWordlist: could not read wordlist file at "${absolutePath}". ` +
89
+ `Ensure the EFF .txt file is present in the specified directory.\n` +
90
+ `Original error: ${msg}`);
91
+ }
92
+ // ── Parse lines ─────────────────────────────────────────────────────────────
93
+ const seen = new Set();
94
+ const words = [];
95
+ for (const rawLine of raw.split(/\r?\n/)) {
96
+ const line = rawLine.trim();
97
+ // Skip blank lines and comments
98
+ if (line.length === 0 || line.startsWith("#"))
99
+ continue;
100
+ // Numbered format: "11111\tword" or "1-1-1-1-1\tword"
101
+ // Plain format: "word"
102
+ const word = line.includes("\t")
103
+ ? line.split("\t")[1]?.trim().toLowerCase()
104
+ : line.toLowerCase();
105
+ if (!word || word.length < 2)
106
+ continue;
107
+ // Deduplicate (paranoid guard — EFF lists should already be unique)
108
+ if (!seen.has(word)) {
109
+ seen.add(word);
110
+ words.push(word);
111
+ }
112
+ }
113
+ // ── Validate result ─────────────────────────────────────────────────────────
114
+ if (words.length < 10) {
115
+ throw new Error(`loadEFFWordlist: file "${absolutePath}" yielded only ${words.length} valid word(s). ` +
116
+ `Expected an EFF wordlist with at least 10 entries.`);
117
+ }
118
+ return Object.freeze(words);
119
+ }
120
+ // ─── Fallback Wordlist ────────────────────────────────────────────────────────
121
+ /**
122
+ * Compact built-in fallback wordlist (256 words).
123
+ *
124
+ * This is used by `getWordlist()` when no external file is provided and
125
+ * `allowFallback` is `true`. It satisfies the EFF's criteria of being
126
+ * unambiguous, easy to spell, and free of visually confusable entries.
127
+ *
128
+ * **Do not import this array directly for production passphrases** — use
129
+ * `getWordlist()` instead, which will prefer a full EFF file when available.
130
+ */
131
+ exports.FALLBACK_WORDLIST = Object.freeze([
132
+ "able",
133
+ "acid",
134
+ "aged",
135
+ "also",
136
+ "area",
137
+ "army",
138
+ "away",
139
+ "baby",
140
+ "back",
141
+ "bail",
142
+ "bake",
143
+ "ball",
144
+ "barn",
145
+ "base",
146
+ "bath",
147
+ "beam",
148
+ "bear",
149
+ "beat",
150
+ "been",
151
+ "bell",
152
+ "belt",
153
+ "best",
154
+ "bird",
155
+ "bite",
156
+ "blade",
157
+ "bold",
158
+ "bolt",
159
+ "bond",
160
+ "bone",
161
+ "book",
162
+ "boom",
163
+ "boot",
164
+ "born",
165
+ "both",
166
+ "bowl",
167
+ "bred",
168
+ "brew",
169
+ "bull",
170
+ "burn",
171
+ "bush",
172
+ "busy",
173
+ "cage",
174
+ "calm",
175
+ "came",
176
+ "camp",
177
+ "card",
178
+ "care",
179
+ "cart",
180
+ "case",
181
+ "cash",
182
+ "cast",
183
+ "cave",
184
+ "cent",
185
+ "chat",
186
+ "chef",
187
+ "chin",
188
+ "chip",
189
+ "city",
190
+ "clam",
191
+ "clap",
192
+ "clay",
193
+ "clip",
194
+ "club",
195
+ "clue",
196
+ "coal",
197
+ "coat",
198
+ "code",
199
+ "coil",
200
+ "coin",
201
+ "cold",
202
+ "colt",
203
+ "cord",
204
+ "core",
205
+ "cork",
206
+ "corn",
207
+ "cost",
208
+ "coup",
209
+ "crab",
210
+ "crew",
211
+ "crop",
212
+ "crow",
213
+ "cube",
214
+ "cure",
215
+ "curl",
216
+ "cute",
217
+ "dark",
218
+ "dart",
219
+ "data",
220
+ "date",
221
+ "dawn",
222
+ "days",
223
+ "dead",
224
+ "deal",
225
+ "dean",
226
+ "debt",
227
+ "deck",
228
+ "deed",
229
+ "deep",
230
+ "deer",
231
+ "desk",
232
+ "dew",
233
+ "dial",
234
+ "diet",
235
+ "dime",
236
+ "dirt",
237
+ "dish",
238
+ "disk",
239
+ "dive",
240
+ "dock",
241
+ "doll",
242
+ "dome",
243
+ "done",
244
+ "door",
245
+ "dose",
246
+ "dote",
247
+ "dove",
248
+ "down",
249
+ "draw",
250
+ "drop",
251
+ "drum",
252
+ "dual",
253
+ "duel",
254
+ "dune",
255
+ "dust",
256
+ "duty",
257
+ "each",
258
+ "earl",
259
+ "earn",
260
+ "ease",
261
+ "east",
262
+ "easy",
263
+ "edge",
264
+ "edit",
265
+ "epic",
266
+ "even",
267
+ "exam",
268
+ "exit",
269
+ "face",
270
+ "fact",
271
+ "fair",
272
+ "fall",
273
+ "fame",
274
+ "farm",
275
+ "fate",
276
+ "fern",
277
+ "file",
278
+ "fill",
279
+ "film",
280
+ "find",
281
+ "fire",
282
+ "firm",
283
+ "fish",
284
+ "fist",
285
+ "flag",
286
+ "flat",
287
+ "flaw",
288
+ "fled",
289
+ "flew",
290
+ "flip",
291
+ "flow",
292
+ "foam",
293
+ "fold",
294
+ "folk",
295
+ "fond",
296
+ "font",
297
+ "food",
298
+ "fool",
299
+ "fork",
300
+ "form",
301
+ "fort",
302
+ "foul",
303
+ "four",
304
+ "free",
305
+ "from",
306
+ "fuel",
307
+ "full",
308
+ "fund",
309
+ "fuse",
310
+ "gain",
311
+ "gale",
312
+ "gaze",
313
+ "gear",
314
+ "gene",
315
+ "gift",
316
+ "girl",
317
+ "give",
318
+ "glad",
319
+ "glow",
320
+ "glue",
321
+ "goal",
322
+ "gold",
323
+ "golf",
324
+ "gone",
325
+ "good",
326
+ "gore",
327
+ "gown",
328
+ "grab",
329
+ "grin",
330
+ "grip",
331
+ "grow",
332
+ "gulf",
333
+ "hall",
334
+ "halt",
335
+ "hare",
336
+ "harm",
337
+ "harp",
338
+ "haul",
339
+ "have",
340
+ "haze",
341
+ "head",
342
+ "heap",
343
+ "heat",
344
+ "heel",
345
+ "help",
346
+ "herb",
347
+ "hide",
348
+ "high",
349
+ "hill",
350
+ "hint",
351
+ "hire",
352
+ "hold",
353
+ "hole",
354
+ "home",
355
+ "hook",
356
+ "hope",
357
+ "horn",
358
+ "huge",
359
+ "hull",
360
+ "hunt",
361
+ "hymn",
362
+ "icon",
363
+ "idea",
364
+ "idle",
365
+ "inch",
366
+ "into",
367
+ "iris",
368
+ "iron",
369
+ "jade",
370
+ "jail",
371
+ "jest",
372
+ "join",
373
+ "joke",
374
+ "jury",
375
+ "just",
376
+ "keen",
377
+ "keep",
378
+ "kern",
379
+ "kind",
380
+ "king",
381
+ "knee",
382
+ "knew",
383
+ "knit",
384
+ ]);
385
+ /**
386
+ * Unified wordlist accessor: tries to load an EFF file, falls back to the
387
+ * built-in list according to `allowFallback`.
388
+ *
389
+ * Use this function in `PasswordManager.generatePassphrase()` to stay
390
+ * decoupled from both the file system and the hardcoded list.
391
+ *
392
+ * @param options - File location, variant, and fallback policy.
393
+ * @returns A readonly array of words suitable for passphrase generation.
394
+ *
395
+ * @example
396
+ * // Prefer the large EFF list; warn & fall back if absent
397
+ * const words = getWordlist({ dir: "./assets/wordlists", variant: "large" });
398
+ *
399
+ * @example
400
+ * // Never fall back — throw if the file is missing
401
+ * const words = getWordlist({ filePath: "./eff_large_wordlist.txt", allowFallback: false });
402
+ *
403
+ * @example
404
+ * // Only use the built-in list (no file needed)
405
+ * const words = getWordlist({ allowFallback: "silent" });
406
+ * // → returns FALLBACK_WORDLIST without attempting any file read
407
+ */
408
+ function getWordlist(options = {}) {
409
+ const { allowFallback = "warn", ...loadOptions } = options;
410
+ // If no file location is specified and fallback is allowed, skip the I/O
411
+ // entirely and return the built-in list immediately.
412
+ const hasFileHint = Boolean(loadOptions.filePath ?? loadOptions.dir);
413
+ if (!hasFileHint && allowFallback !== false) {
414
+ if (allowFallback === "warn") {
415
+ console.warn("[PasswordMDict] No EFF wordlist path provided. " +
416
+ "Using built-in 256-word fallback list. " +
417
+ "For production use, supply `dir` or `filePath` pointing to an EFF .txt file.");
418
+ }
419
+ return exports.FALLBACK_WORDLIST;
420
+ }
421
+ try {
422
+ return loadEFFWordlist(loadOptions);
423
+ }
424
+ catch (err) {
425
+ if (allowFallback === false)
426
+ throw err;
427
+ if (allowFallback === "warn") {
428
+ console.warn(`[PasswordMDict] Failed to load EFF wordlist: ${err.message}\n` +
429
+ `Falling back to built-in 256-word list.`);
430
+ }
431
+ return exports.FALLBACK_WORDLIST;
432
+ }
433
+ }
434
+ //# sourceMappingURL=PasswordMDict.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PasswordMDict.js","sourceRoot":"","sources":["../../../src/mods/PasswordMDict.ts"],"names":[],"mappings":";AAAA;;;;;;;8EAO8E;;;AAoG9E,0CA8DC;AAuTD,kCAgCC;AAvfD,2BAAkC;AAClC,+BAA+B;AAE/B,iFAAiF;AAEpE,QAAA,QAAQ,GAAG;IACtB,SAAS,EAAE,4BAA4B;IACvC,SAAS,EAAE,4BAA4B;IACvC,OAAO,EAAE,YAAY;IACrB,OAAO,EAAE,4BAA4B;IACrC,YAAY,EAAE,WAAW;CACjB,CAAC;AAEX,0DAA0D;AAC7C,QAAA,mBAAmB,GAAG,CAAC,CAAC;AACrC,0DAA0D;AAC7C,QAAA,mBAAmB,GAAG,GAAG,CAAC;AAevC;;;;;;GAMG;AACU,QAAA,aAAa,GAAuC;IAC/D,KAAK,EAAE,wBAAwB;IAC/B,MAAM,EAAE,0BAA0B;IAClC,MAAM,EAAE,4BAA4B;CACrC,CAAC;AA0BF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,SAAgB,eAAe,CAC7B,UAA+B,EAAE;IAEjC,MAAM,EAAE,GAAG,EAAE,OAAO,GAAG,OAAO,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IAErD,+EAA+E;IAC/E,IAAI,YAAoB,CAAC;IAEzB,IAAI,QAAQ,EAAE,CAAC;QACb,YAAY,GAAG,IAAA,cAAO,EAAC,QAAQ,CAAC,CAAC;IACnC,CAAC;SAAM,CAAC;QACN,MAAM,O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M;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,KAAK;IACL,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,M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