@kasperpeulen/vitest-plugin-nextjs 0.0.0-stage → 0.1.0-alpha.1
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 +249 -2
- package/dist/_virtual/_rolldown/runtime.js +14 -0
- package/dist/action-ids.d.ts +18 -0
- package/dist/action-ids.js +44 -0
- package/dist/adapter.d.ts +8 -0
- package/dist/adapter.js +12 -0
- package/dist/app-requests.d.ts +63 -0
- package/dist/app-requests.js +253 -0
- package/dist/browser-context.d.ts +24 -0
- package/dist/browser-context.js +157 -0
- package/dist/build-output.d.ts +68 -0
- package/dist/build-output.js +216 -0
- package/dist/build.d.ts +26 -0
- package/dist/build.js +39 -0
- package/dist/built-files.d.ts +9 -0
- package/dist/built-files.js +22 -0
- package/dist/cache.d.ts +44 -0
- package/dist/cache.js +99 -0
- package/dist/client-components.d.ts +3 -0
- package/dist/client-components.js +4 -0
- package/dist/client-file-key.d.ts +5 -0
- package/dist/client-file-key.js +5 -0
- package/dist/client-files.d.ts +83 -0
- package/dist/client-files.js +186 -0
- package/dist/client-graph.d.ts +94 -0
- package/dist/client-graph.js +266 -0
- package/dist/client-modules.d.ts +10 -0
- package/dist/client-modules.js +43 -0
- package/dist/client.d.ts +42 -0
- package/dist/client.js +263 -0
- package/dist/commonjs.d.ts +44 -0
- package/dist/commonjs.js +111 -0
- package/dist/compat/browser/client.d.ts +19 -0
- package/dist/compat/browser/client.js +13 -0
- package/dist/compat/build.d.ts +145 -0
- package/dist/compat/build.js +149 -0
- package/dist/compat/checks.d.ts +16 -0
- package/dist/compat/checks.js +148 -0
- package/dist/compat/patches.d.ts +13 -0
- package/dist/compat/patches.js +30 -0
- package/dist/compat/paths.d.ts +74 -0
- package/dist/compat/paths.js +160 -0
- package/dist/compat/rsc/handlers.d.ts +2 -0
- package/dist/compat/rsc/handlers.js +2 -0
- package/dist/compat/rsc/prerender.d.ts +10 -0
- package/dist/compat/rsc/prerender.js +9 -0
- package/dist/compat/server/headers.d.ts +3 -0
- package/dist/compat/server/headers.js +3 -0
- package/dist/compat/ssr/build-output.d.ts +4 -0
- package/dist/compat/ssr/build-output.js +3 -0
- package/dist/compat/ssr/cache.d.ts +6 -0
- package/dist/compat/ssr/cache.js +6 -0
- package/dist/compat/ssr/handler.d.ts +8 -0
- package/dist/compat/ssr/handler.js +8 -0
- package/dist/compat/ssr/node-server.d.ts +5 -0
- package/dist/compat/ssr/node-server.js +4 -0
- package/dist/compat/ssr/render-errors.d.ts +4 -0
- package/dist/compat/ssr/render-errors.js +4 -0
- package/dist/compat/ssr/senders.d.ts +6 -0
- package/dist/compat/ssr/senders.js +6 -0
- package/dist/compat/types.d.ts +8 -0
- package/dist/compat/types.js +1 -0
- package/dist/compile.d.ts +39 -0
- package/dist/compile.js +175 -0
- package/dist/disk.d.ts +16 -0
- package/dist/disk.js +13 -0
- package/dist/document-loads.d.ts +15 -0
- package/dist/document-loads.js +53 -0
- package/dist/document.d.ts +79 -0
- package/dist/document.js +330 -0
- package/dist/downloads.d.ts +15 -0
- package/dist/downloads.js +71 -0
- package/dist/esm-require.d.ts +11 -0
- package/dist/esm-require.js +32 -0
- package/dist/fast-crypto/index.js +1093 -0
- package/dist/fast-crypto.d.ts +20 -0
- package/dist/fast-crypto.js +151 -0
- package/dist/flight.d.ts +19 -0
- package/dist/flight.js +42 -0
- package/dist/form-submission.d.ts +15 -0
- package/dist/form-submission.js +27 -0
- package/dist/from-page.d.ts +5 -0
- package/dist/from-page.js +44 -0
- package/dist/globals.d.ts +1 -0
- package/dist/globals.js +197 -0
- package/dist/host-document.d.ts +26 -0
- package/dist/host-document.js +34 -0
- package/dist/host-return-shared.d.ts +5 -0
- package/dist/host-return-shared.js +5 -0
- package/dist/host-return.d.ts +5 -0
- package/dist/host-return.js +16 -0
- package/dist/index.d.ts +280 -0
- package/dist/index.js +281 -0
- package/dist/internal.d.ts +2 -0
- package/dist/internal.js +3 -0
- package/dist/leftovers.d.ts +11 -0
- package/dist/leftovers.js +55 -0
- package/dist/mode.d.ts +169 -0
- package/dist/mode.js +31 -0
- package/dist/node/LICENSES.md +3540 -0
- package/dist/node/assert/strict.js +29 -0
- package/dist/node/assert.js +3044 -0
- package/dist/node/buffer.js +1499 -0
- package/dist/node/child_process.js +45 -0
- package/dist/node/cluster.js +85 -0
- package/dist/node/console.js +96 -0
- package/dist/node/constants.js +495 -0
- package/dist/node/crypto.js +1388 -0
- package/dist/node/dgram.js +78 -0
- package/dist/node/diagnostics_channel.js +122 -0
- package/dist/node/dns/promises.js +129 -0
- package/dist/node/dns.js +137 -0
- package/dist/node/domain.js +43 -0
- package/dist/node/events.js +1155 -0
- package/dist/node/fs/promises.js +40 -0
- package/dist/node/fs.js +10375 -0
- package/dist/node/http.js +326 -0
- package/dist/node/http2.js +305 -0
- package/dist/node/https.js +57 -0
- package/dist/node/inspector/promises.js +66 -0
- package/dist/node/inspector.js +76 -0
- package/dist/node/module.js +205 -0
- package/dist/node/net.js +392 -0
- package/dist/node/os.js +259 -0
- package/dist/node/path/posix.js +25 -0
- package/dist/node/path/win32.js +25 -0
- package/dist/node/path.js +384 -0
- package/dist/node/perf_hooks.js +313 -0
- package/dist/node/process.js +452 -0
- package/dist/node/punycode.js +178 -0
- package/dist/node/querystring.js +934 -0
- package/dist/node/readline/promises.js +71 -0
- package/dist/node/readline.js +56 -0
- package/dist/node/repl.js +44 -0
- package/dist/node/sqlite.js +22 -0
- package/dist/node/stream/consumers.js +47 -0
- package/dist/node/stream/promises.js +6 -0
- package/dist/node/stream/web.js +52 -0
- package/dist/node/stream.js +4323 -0
- package/dist/node/string_decoder.js +276 -0
- package/dist/node/sys.js +6 -0
- package/dist/node/timers/promises.js +71 -0
- package/dist/node/timers.js +133 -0
- package/dist/node/tls.js +122 -0
- package/dist/node/trace_events.js +23 -0
- package/dist/node/tty.js +69 -0
- package/dist/node/url.js +1426 -0
- package/dist/node/util/types.js +1456 -0
- package/dist/node/util.js +4807 -0
- package/dist/node/v8.js +160 -0
- package/dist/node/vm.js +88 -0
- package/dist/node/wasi.js +16 -0
- package/dist/node/worker_threads.js +123 -0
- package/dist/node/zlib.js +1396 -0
- package/dist/node-builtins.d.ts +40 -0
- package/dist/node-builtins.js +74 -0
- package/dist/node-on-page.d.ts +46 -0
- package/dist/node-on-page.js +101 -0
- package/dist/node-platform.d.ts +36 -0
- package/dist/node-platform.js +152 -0
- package/dist/node-rendered.d.ts +21 -0
- package/dist/node-rendered.js +26 -0
- package/dist/node-server.d.ts +46 -0
- package/dist/node-server.js +193 -0
- package/dist/not-found-page.d.ts +19 -0
- package/dist/not-found-page.js +74 -0
- package/dist/optimizer-cache-key.d.ts +26 -0
- package/dist/optimizer-cache-key.js +73 -0
- package/dist/own-package.d.ts +1 -0
- package/dist/own-package.js +6 -0
- package/dist/page-store.d.ts +33 -0
- package/dist/page-store.js +80 -0
- package/dist/page-timers.d.ts +22 -0
- package/dist/page-timers.js +47 -0
- package/dist/page.d.ts +112 -0
- package/dist/page.js +549 -0
- package/dist/paths.d.ts +13 -0
- package/dist/paths.js +47 -0
- package/dist/plugin.d.ts +23 -0
- package/dist/plugin.js +1006 -0
- package/dist/prerender-verdict.d.ts +8 -0
- package/dist/prerender-verdict.js +67 -0
- package/dist/project/context.d.ts +546 -0
- package/dist/project/context.js +111 -0
- package/dist/project/entries.d.ts +42 -0
- package/dist/project/entries.js +189 -0
- package/dist/project/env-worker.d.ts +1 -0
- package/dist/project/env-worker.js +9 -0
- package/dist/project/env.d.ts +36 -0
- package/dist/project/env.js +82 -0
- package/dist/project/layers.d.ts +31 -0
- package/dist/project/layers.js +150 -0
- package/dist/project/loaders.d.ts +71 -0
- package/dist/project/loaders.js +300 -0
- package/dist/project/metadata.d.ts +8 -0
- package/dist/project/metadata.js +34 -0
- package/dist/project/module-exports.d.ts +29 -0
- package/dist/project/module-exports.js +77 -0
- package/dist/project/routes.d.ts +19 -0
- package/dist/project/routes.js +92 -0
- package/dist/project/routing.d.ts +46 -0
- package/dist/project/routing.js +280 -0
- package/dist/project/transform.d.ts +8 -0
- package/dist/project/transform.js +110 -0
- package/dist/project/webpack.d.ts +65 -0
- package/dist/project/webpack.js +191 -0
- package/dist/project.d.ts +269 -0
- package/dist/project.js +58 -0
- package/dist/registry-global.d.ts +5 -0
- package/dist/registry-global.js +5 -0
- package/dist/registry.d.ts +241 -0
- package/dist/registry.js +30 -0
- package/dist/route-chunks.d.ts +13 -0
- package/dist/route-chunks.js +32 -0
- package/dist/route-lookup.d.ts +34 -0
- package/dist/route-lookup.js +207 -0
- package/dist/routes-ahead-shared.d.ts +17 -0
- package/dist/routes-ahead-shared.js +9 -0
- package/dist/routes-ahead.d.ts +10 -0
- package/dist/routes-ahead.js +54 -0
- package/dist/rsc.d.ts +19 -0
- package/dist/rsc.js +171 -0
- package/dist/server-action.d.ts +9 -0
- package/dist/server-action.js +15 -0
- package/dist/server-code.d.ts +176 -0
- package/dist/server-code.js +357 -0
- package/dist/server-in-front.d.ts +37 -0
- package/dist/server-in-front.js +90 -0
- package/dist/server-layers.d.ts +22 -0
- package/dist/server-layers.js +33 -0
- package/dist/setup-browser.d.ts +1 -0
- package/dist/setup-browser.js +8 -0
- package/dist/setup-node.d.ts +1 -0
- package/dist/setup-node.js +6 -0
- package/dist/setup.d.ts +8 -0
- package/dist/setup.js +62 -0
- package/dist/speed-features.d.ts +13 -0
- package/dist/speed-features.js +95 -0
- package/dist/ssr.d.ts +70 -0
- package/dist/ssr.js +480 -0
- package/dist/static-build.d.ts +36 -0
- package/dist/static-build.js +92 -0
- package/dist/storage.d.ts +31 -0
- package/dist/storage.js +94 -0
- package/dist/styles-shared.d.ts +137 -0
- package/dist/styles-shared.js +124 -0
- package/dist/styles.d.ts +102 -0
- package/dist/styles.js +730 -0
- package/dist/stylesheet-versions.d.ts +17 -0
- package/dist/stylesheet-versions.js +43 -0
- package/dist/tester.html +10 -0
- package/dist/use-cache.d.ts +15 -0
- package/dist/use-cache.js +93 -0
- package/dist/vitest-version.d.ts +6 -0
- package/dist/vitest-version.js +12 -0
- package/package.json +125 -3
|
@@ -0,0 +1,1388 @@
|
|
|
1
|
+
import { Buffer as Buffer$1 } from "@kasperpeulen/vitest-plugin-nextjs/node/buffer";
|
|
2
|
+
import { Transform } from "@kasperpeulen/vitest-plugin-nextjs/node/stream";
|
|
3
|
+
//#region ../../node_modules/.pnpm/@noble+hashes@2.4.0/node_modules/@noble/hashes/utils.js
|
|
4
|
+
function isBytes(a) {
|
|
5
|
+
return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array" && "BYTES_PER_ELEMENT" in a && a.BYTES_PER_ELEMENT === 1;
|
|
6
|
+
}
|
|
7
|
+
const atitle = (title) => title ? `"${title}" ` : "";
|
|
8
|
+
function anumber(n, title = "") {
|
|
9
|
+
if (typeof n !== "number") throw new TypeError(atitle(title) + "expected number, got " + typeof n);
|
|
10
|
+
if (!Number.isSafeInteger(n) || n < 0) throw new RangeError(atitle(title) + "expected integer >= 0, got " + n);
|
|
11
|
+
return n;
|
|
12
|
+
}
|
|
13
|
+
function abytes(value, length, title = "") {
|
|
14
|
+
if (isBytes(value) && (length === void 0 || value.length === length)) return value;
|
|
15
|
+
if (length !== void 0) anumber(length, "length");
|
|
16
|
+
const bytes = isBytes(value);
|
|
17
|
+
const ofLen = length !== void 0 ? ` of length ${length}` : "";
|
|
18
|
+
const got = bytes ? `length=${value.length}` : `type=${typeof value}`;
|
|
19
|
+
const message = atitle(title) + "expected Uint8Array" + ofLen + ", got " + got;
|
|
20
|
+
if (!bytes) throw new TypeError(message);
|
|
21
|
+
throw new RangeError(message);
|
|
22
|
+
}
|
|
23
|
+
function ahash(h) {
|
|
24
|
+
if (typeof h !== "function" || typeof h.create !== "function") throw new TypeError("expected hash wrapped by utils.createHasher");
|
|
25
|
+
anumber(h.outputLen);
|
|
26
|
+
anumber(h.blockLen);
|
|
27
|
+
if (h.outputLen < 1 || h.blockLen < 1) throw new Error("hash blockLen / outputLen must be >= 1");
|
|
28
|
+
}
|
|
29
|
+
const aobject = (value, label) => {
|
|
30
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) throw new TypeError((label === "object" ? "" : `"${label}" `) + "expected object, got type=" + typeof value);
|
|
31
|
+
};
|
|
32
|
+
const aopts = (value, label) => {
|
|
33
|
+
aobject(value, label);
|
|
34
|
+
const proto = Object.getPrototypeOf(value);
|
|
35
|
+
if (proto !== Object.prototype && proto !== null) throw new TypeError(`"${label}" expected plain object`);
|
|
36
|
+
if (Object.hasOwn(value, "__proto__")) throw new TypeError(`"${label}.__proto__" is not allowed`);
|
|
37
|
+
};
|
|
38
|
+
function aexists(instance, checkFinished = true) {
|
|
39
|
+
if (instance.destroyed) throw new Error("hash was destroyed");
|
|
40
|
+
if (checkFinished && instance.finished) throw new Error("digest() was already called");
|
|
41
|
+
}
|
|
42
|
+
function aoutput(out, instance) {
|
|
43
|
+
abytes(out, void 0, "output");
|
|
44
|
+
const min = instance.outputLen;
|
|
45
|
+
if (!(out.length >= min)) throw new RangeError("\"output\" expected length >= " + min);
|
|
46
|
+
}
|
|
47
|
+
function clean(...arrays) {
|
|
48
|
+
for (let i = 0; i < arrays.length; i++) arrays[i].fill(0);
|
|
49
|
+
}
|
|
50
|
+
function createView(arr) {
|
|
51
|
+
return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
|
|
52
|
+
}
|
|
53
|
+
function rotr(word, shift) {
|
|
54
|
+
return word << 32 - shift | word >>> shift;
|
|
55
|
+
}
|
|
56
|
+
function rotl(word, shift) {
|
|
57
|
+
return word << shift | word >>> 32 - shift >>> 0;
|
|
58
|
+
}
|
|
59
|
+
function checkOpts(defaults, opts, title = "opts") {
|
|
60
|
+
aopts(defaults, "defaults");
|
|
61
|
+
if (opts !== void 0) aopts(opts, title);
|
|
62
|
+
return Object.assign(Object.create(null), defaults, opts);
|
|
63
|
+
}
|
|
64
|
+
function createHasher(hashCons, info = {}) {
|
|
65
|
+
if (typeof hashCons !== "function") throw new TypeError("\"hashCons\" expected function, got type=" + typeof hashCons);
|
|
66
|
+
info = checkOpts({}, info, "info");
|
|
67
|
+
const hashC = (msg, opts) => hashCons(opts).update(msg).digest();
|
|
68
|
+
const tmp = hashCons(void 0);
|
|
69
|
+
hashC.outputLen = tmp.outputLen;
|
|
70
|
+
hashC.blockLen = tmp.blockLen;
|
|
71
|
+
hashC.canXOF = tmp.canXOF;
|
|
72
|
+
hashC.create = (opts) => hashCons(opts);
|
|
73
|
+
Object.assign(hashC, info);
|
|
74
|
+
return Object.freeze(hashC);
|
|
75
|
+
}
|
|
76
|
+
const oidNist = (suffix) => ({ oid: Uint8Array.from([
|
|
77
|
+
6,
|
|
78
|
+
9,
|
|
79
|
+
96,
|
|
80
|
+
134,
|
|
81
|
+
72,
|
|
82
|
+
1,
|
|
83
|
+
101,
|
|
84
|
+
3,
|
|
85
|
+
4,
|
|
86
|
+
2,
|
|
87
|
+
suffix
|
|
88
|
+
]) });
|
|
89
|
+
//#endregion
|
|
90
|
+
//#region ../../node_modules/.pnpm/@noble+hashes@2.4.0/node_modules/@noble/hashes/hmac.js
|
|
91
|
+
var _HMAC = class {
|
|
92
|
+
oHash;
|
|
93
|
+
iHash;
|
|
94
|
+
blockLen;
|
|
95
|
+
outputLen;
|
|
96
|
+
canXOF = false;
|
|
97
|
+
finished = false;
|
|
98
|
+
destroyed = false;
|
|
99
|
+
constructor(hash, key) {
|
|
100
|
+
ahash(hash);
|
|
101
|
+
abytes(key, void 0, "key");
|
|
102
|
+
this.iHash = hash.create();
|
|
103
|
+
if (typeof this.iHash.update !== "function") throw new Error("expected Hash instance");
|
|
104
|
+
this.blockLen = this.iHash.blockLen;
|
|
105
|
+
this.outputLen = this.iHash.outputLen;
|
|
106
|
+
const blockLen = this.blockLen;
|
|
107
|
+
const pad = new Uint8Array(blockLen);
|
|
108
|
+
pad.set(key.length > blockLen ? hash.create().update(key).digest() : key);
|
|
109
|
+
for (let i = 0; i < pad.length; i++) pad[i] ^= 54;
|
|
110
|
+
this.iHash.update(pad);
|
|
111
|
+
this.oHash = hash.create();
|
|
112
|
+
for (let i = 0; i < pad.length; i++) pad[i] ^= 106;
|
|
113
|
+
this.oHash.update(pad);
|
|
114
|
+
clean(pad);
|
|
115
|
+
}
|
|
116
|
+
update(buf) {
|
|
117
|
+
aexists(this);
|
|
118
|
+
this.iHash.update(buf);
|
|
119
|
+
return this;
|
|
120
|
+
}
|
|
121
|
+
digestInto(out) {
|
|
122
|
+
aexists(this);
|
|
123
|
+
aoutput(out, this);
|
|
124
|
+
this.finished = true;
|
|
125
|
+
const buf = out.subarray(0, this.outputLen);
|
|
126
|
+
this.iHash.digestInto(buf);
|
|
127
|
+
this.oHash.update(buf);
|
|
128
|
+
this.oHash.digestInto(buf);
|
|
129
|
+
this.destroy();
|
|
130
|
+
}
|
|
131
|
+
digest() {
|
|
132
|
+
const out = new Uint8Array(this.oHash.outputLen);
|
|
133
|
+
this.digestInto(out);
|
|
134
|
+
return out;
|
|
135
|
+
}
|
|
136
|
+
_cloneInto(to) {
|
|
137
|
+
to ||= Object.create(Object.getPrototypeOf(this), {});
|
|
138
|
+
const { oHash, iHash, finished, destroyed, blockLen, outputLen, canXOF } = this;
|
|
139
|
+
to = to;
|
|
140
|
+
to.finished = finished;
|
|
141
|
+
to.destroyed = destroyed;
|
|
142
|
+
to.blockLen = blockLen;
|
|
143
|
+
to.outputLen = outputLen;
|
|
144
|
+
to.canXOF = canXOF;
|
|
145
|
+
to.oHash = oHash._cloneInto(to.oHash);
|
|
146
|
+
to.iHash = iHash._cloneInto(to.iHash);
|
|
147
|
+
return to;
|
|
148
|
+
}
|
|
149
|
+
clone() {
|
|
150
|
+
return this._cloneInto();
|
|
151
|
+
}
|
|
152
|
+
destroy() {
|
|
153
|
+
this.destroyed = true;
|
|
154
|
+
this.oHash.destroy();
|
|
155
|
+
this.iHash.destroy();
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
const hmac = /* @__PURE__ */ (() => {
|
|
159
|
+
const hmac_ = ((hash, key, message) => new _HMAC(hash, key).update(message).digest());
|
|
160
|
+
hmac_.create = (hash, key) => new _HMAC(hash, key);
|
|
161
|
+
return hmac_;
|
|
162
|
+
})();
|
|
163
|
+
//#endregion
|
|
164
|
+
//#region ../../node_modules/.pnpm/@noble+hashes@2.4.0/node_modules/@noble/hashes/_u64.js
|
|
165
|
+
const U32_MASK64 = /* @__PURE__ */ (() => BigInt(2 ** 32 - 1))();
|
|
166
|
+
const _32n = /* @__PURE__ */ BigInt(32);
|
|
167
|
+
function fromBig(n, le = false) {
|
|
168
|
+
if (le) return {
|
|
169
|
+
h: Number(n & U32_MASK64),
|
|
170
|
+
l: Number(n >> _32n & U32_MASK64)
|
|
171
|
+
};
|
|
172
|
+
return {
|
|
173
|
+
h: Number(n >> _32n & U32_MASK64) | 0,
|
|
174
|
+
l: Number(n & U32_MASK64) | 0
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
function split(lst, le = false) {
|
|
178
|
+
const len = lst.length;
|
|
179
|
+
let Ah = new Uint32Array(len);
|
|
180
|
+
let Al = new Uint32Array(len);
|
|
181
|
+
for (let i = 0; i < len; i++) {
|
|
182
|
+
const { h, l } = fromBig(lst[i], le);
|
|
183
|
+
[Ah[i], Al[i]] = [h, l];
|
|
184
|
+
}
|
|
185
|
+
return [Ah, Al];
|
|
186
|
+
}
|
|
187
|
+
const fromNumH = (n) => n / 2 ** 32 | 0;
|
|
188
|
+
const fromNumL = (n) => n >>> 0;
|
|
189
|
+
function setU64FromNum(view, byteOffset, n, isLE) {
|
|
190
|
+
const h = fromNumH(n);
|
|
191
|
+
const l = fromNumL(n);
|
|
192
|
+
view.setUint32(byteOffset, isLE ? l : h, isLE);
|
|
193
|
+
view.setUint32(byteOffset + 4, isLE ? h : l, isLE);
|
|
194
|
+
}
|
|
195
|
+
const shrSH = (h, _l, s) => h >>> s;
|
|
196
|
+
const shrSL = (h, l, s) => h << 32 - s | l >>> s;
|
|
197
|
+
const rotrSH = (h, l, s) => h >>> s | l << 32 - s;
|
|
198
|
+
const rotrSL = (h, l, s) => h << 32 - s | l >>> s;
|
|
199
|
+
const rotrBH = (h, l, s) => h << 64 - s | l >>> s - 32;
|
|
200
|
+
const rotrBL = (h, l, s) => h >>> s - 32 | l << 64 - s;
|
|
201
|
+
function add(Ah, Al, Bh, Bl) {
|
|
202
|
+
const l = (Al >>> 0) + (Bl >>> 0);
|
|
203
|
+
return {
|
|
204
|
+
h: Ah + Bh + (l / 2 ** 32 | 0) | 0,
|
|
205
|
+
l: l | 0
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
const add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);
|
|
209
|
+
const add3H = (low, Ah, Bh, Ch) => Ah + Bh + Ch + (low / 2 ** 32 | 0) | 0;
|
|
210
|
+
const add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);
|
|
211
|
+
const add4H = (low, Ah, Bh, Ch, Dh) => Ah + Bh + Ch + Dh + (low / 2 ** 32 | 0) | 0;
|
|
212
|
+
const add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);
|
|
213
|
+
const add5H = (low, Ah, Bh, Ch, Dh, Eh) => Ah + Bh + Ch + Dh + Eh + (low / 2 ** 32 | 0) | 0;
|
|
214
|
+
//#endregion
|
|
215
|
+
//#region ../../node_modules/.pnpm/@noble+hashes@2.4.0/node_modules/@noble/hashes/_md.js
|
|
216
|
+
function Chi(a, b, c) {
|
|
217
|
+
return a & b ^ ~a & c;
|
|
218
|
+
}
|
|
219
|
+
function Maj(a, b, c) {
|
|
220
|
+
return a & b ^ a & c ^ b & c;
|
|
221
|
+
}
|
|
222
|
+
var HashMD = class {
|
|
223
|
+
blockLen;
|
|
224
|
+
outputLen;
|
|
225
|
+
canXOF = false;
|
|
226
|
+
padOffset;
|
|
227
|
+
isLE;
|
|
228
|
+
buffer;
|
|
229
|
+
view;
|
|
230
|
+
finished = false;
|
|
231
|
+
length = 0;
|
|
232
|
+
pos = 0;
|
|
233
|
+
destroyed = false;
|
|
234
|
+
constructor(blockLen, outputLen, padOffset, isLE) {
|
|
235
|
+
this.blockLen = blockLen;
|
|
236
|
+
this.outputLen = outputLen;
|
|
237
|
+
this.padOffset = padOffset;
|
|
238
|
+
this.isLE = isLE;
|
|
239
|
+
this.buffer = new Uint8Array(blockLen);
|
|
240
|
+
this.view = createView(this.buffer);
|
|
241
|
+
}
|
|
242
|
+
update(data) {
|
|
243
|
+
aexists(this);
|
|
244
|
+
abytes(data);
|
|
245
|
+
const { view, buffer, blockLen } = this;
|
|
246
|
+
const len = data.length;
|
|
247
|
+
let processed = false;
|
|
248
|
+
for (let pos = 0; pos < len;) {
|
|
249
|
+
const take = Math.min(blockLen - this.pos, len - pos);
|
|
250
|
+
if (take === blockLen) {
|
|
251
|
+
const dataView = createView(data);
|
|
252
|
+
for (; blockLen <= len - pos; pos += blockLen) this.process(dataView, pos);
|
|
253
|
+
processed = true;
|
|
254
|
+
continue;
|
|
255
|
+
}
|
|
256
|
+
buffer.set(pos === 0 && take === len ? data : data.subarray(pos, pos + take), this.pos);
|
|
257
|
+
this.pos += take;
|
|
258
|
+
pos += take;
|
|
259
|
+
if (this.pos === blockLen) {
|
|
260
|
+
this.process(view, 0);
|
|
261
|
+
this.pos = 0;
|
|
262
|
+
processed = true;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
this.length += data.length;
|
|
266
|
+
if (processed) this.roundClean();
|
|
267
|
+
return this;
|
|
268
|
+
}
|
|
269
|
+
digestInto(out) {
|
|
270
|
+
aexists(this);
|
|
271
|
+
aoutput(out, this);
|
|
272
|
+
this.finished = true;
|
|
273
|
+
const { buffer, view, blockLen, isLE } = this;
|
|
274
|
+
let { pos } = this;
|
|
275
|
+
buffer[pos++] = 128;
|
|
276
|
+
buffer.fill(0, pos);
|
|
277
|
+
if (this.padOffset > blockLen - pos) {
|
|
278
|
+
this.process(view, 0);
|
|
279
|
+
buffer.fill(0);
|
|
280
|
+
}
|
|
281
|
+
setU64FromNum(view, blockLen - 8, this.length * 8, isLE);
|
|
282
|
+
this.process(view, 0);
|
|
283
|
+
this.roundClean();
|
|
284
|
+
const oview = out === buffer ? view : createView(out);
|
|
285
|
+
const len = this.outputLen;
|
|
286
|
+
const outLen = len / 4;
|
|
287
|
+
const state = this.get();
|
|
288
|
+
if (len % 4 || outLen > state.length) throw new Error("invalid outputLen");
|
|
289
|
+
for (let i = 0; i < outLen; i++) oview.setUint32(4 * i, state[i], isLE);
|
|
290
|
+
}
|
|
291
|
+
digest() {
|
|
292
|
+
const { buffer, outputLen } = this;
|
|
293
|
+
this.digestInto(buffer);
|
|
294
|
+
const res = buffer.slice(0, outputLen);
|
|
295
|
+
this.destroy();
|
|
296
|
+
return res;
|
|
297
|
+
}
|
|
298
|
+
_cloneIntoMeta(to) {
|
|
299
|
+
const { buffer, length, finished, destroyed, pos } = this;
|
|
300
|
+
to.destroyed = destroyed;
|
|
301
|
+
to.finished = finished;
|
|
302
|
+
to.length = length;
|
|
303
|
+
to.pos = pos;
|
|
304
|
+
if (pos) to.buffer.set(buffer);
|
|
305
|
+
return to;
|
|
306
|
+
}
|
|
307
|
+
clone() {
|
|
308
|
+
return this._cloneInto();
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
const SHA256_IV = /* @__PURE__ */ Uint32Array.from([
|
|
312
|
+
1779033703,
|
|
313
|
+
3144134277,
|
|
314
|
+
1013904242,
|
|
315
|
+
2773480762,
|
|
316
|
+
1359893119,
|
|
317
|
+
2600822924,
|
|
318
|
+
528734635,
|
|
319
|
+
1541459225
|
|
320
|
+
]);
|
|
321
|
+
const SHA224_IV = /* @__PURE__ */ Uint32Array.from([
|
|
322
|
+
3238371032,
|
|
323
|
+
914150663,
|
|
324
|
+
812702999,
|
|
325
|
+
4144912697,
|
|
326
|
+
4290775857,
|
|
327
|
+
1750603025,
|
|
328
|
+
1694076839,
|
|
329
|
+
3204075428
|
|
330
|
+
]);
|
|
331
|
+
const SHA384_IV = /* @__PURE__ */ Uint32Array.from([
|
|
332
|
+
3418070365,
|
|
333
|
+
3238371032,
|
|
334
|
+
1654270250,
|
|
335
|
+
914150663,
|
|
336
|
+
2438529370,
|
|
337
|
+
812702999,
|
|
338
|
+
355462360,
|
|
339
|
+
4144912697,
|
|
340
|
+
1731405415,
|
|
341
|
+
4290775857,
|
|
342
|
+
2394180231,
|
|
343
|
+
1750603025,
|
|
344
|
+
3675008525,
|
|
345
|
+
1694076839,
|
|
346
|
+
1203062813,
|
|
347
|
+
3204075428
|
|
348
|
+
]);
|
|
349
|
+
const SHA512_IV = /* @__PURE__ */ Uint32Array.from([
|
|
350
|
+
1779033703,
|
|
351
|
+
4089235720,
|
|
352
|
+
3144134277,
|
|
353
|
+
2227873595,
|
|
354
|
+
1013904242,
|
|
355
|
+
4271175723,
|
|
356
|
+
2773480762,
|
|
357
|
+
1595750129,
|
|
358
|
+
1359893119,
|
|
359
|
+
2917565137,
|
|
360
|
+
2600822924,
|
|
361
|
+
725511199,
|
|
362
|
+
528734635,
|
|
363
|
+
4215389547,
|
|
364
|
+
1541459225,
|
|
365
|
+
327033209
|
|
366
|
+
]);
|
|
367
|
+
//#endregion
|
|
368
|
+
//#region ../../node_modules/.pnpm/@noble+hashes@2.4.0/node_modules/@noble/hashes/legacy.js
|
|
369
|
+
const SHA1_IV = /* @__PURE__ */ Uint32Array.from([
|
|
370
|
+
1732584193,
|
|
371
|
+
4023233417,
|
|
372
|
+
2562383102,
|
|
373
|
+
271733878,
|
|
374
|
+
3285377520
|
|
375
|
+
]);
|
|
376
|
+
const SHA1_W = /* @__PURE__ */ new Uint32Array(80);
|
|
377
|
+
var _SHA1 = class extends HashMD {
|
|
378
|
+
A = SHA1_IV[0] | 0;
|
|
379
|
+
B = SHA1_IV[1] | 0;
|
|
380
|
+
C = SHA1_IV[2] | 0;
|
|
381
|
+
D = SHA1_IV[3] | 0;
|
|
382
|
+
E = SHA1_IV[4] | 0;
|
|
383
|
+
constructor() {
|
|
384
|
+
super(64, 20, 8, false);
|
|
385
|
+
}
|
|
386
|
+
get() {
|
|
387
|
+
const { A, B, C, D, E } = this;
|
|
388
|
+
return [
|
|
389
|
+
A,
|
|
390
|
+
B,
|
|
391
|
+
C,
|
|
392
|
+
D,
|
|
393
|
+
E
|
|
394
|
+
];
|
|
395
|
+
}
|
|
396
|
+
set(A, B, C, D, E) {
|
|
397
|
+
this.A = A | 0;
|
|
398
|
+
this.B = B | 0;
|
|
399
|
+
this.C = C | 0;
|
|
400
|
+
this.D = D | 0;
|
|
401
|
+
this.E = E | 0;
|
|
402
|
+
}
|
|
403
|
+
_cloneInto(to) {
|
|
404
|
+
(to ||= new this.constructor()).set(...this.get());
|
|
405
|
+
return this._cloneIntoMeta(to);
|
|
406
|
+
}
|
|
407
|
+
process(view, offset) {
|
|
408
|
+
for (let i = 0; i < 16; i++, offset += 4) SHA1_W[i] = view.getUint32(offset, false);
|
|
409
|
+
for (let i = 16; i < 80; i++) SHA1_W[i] = rotl(SHA1_W[i - 3] ^ SHA1_W[i - 8] ^ SHA1_W[i - 14] ^ SHA1_W[i - 16], 1);
|
|
410
|
+
let { A, B, C, D, E } = this;
|
|
411
|
+
for (let i = 0; i < 80; i++) {
|
|
412
|
+
let F, K;
|
|
413
|
+
if (i < 20) {
|
|
414
|
+
F = Chi(B, C, D);
|
|
415
|
+
K = 1518500249;
|
|
416
|
+
} else if (i < 40) {
|
|
417
|
+
F = B ^ C ^ D;
|
|
418
|
+
K = 1859775393;
|
|
419
|
+
} else if (i < 60) {
|
|
420
|
+
F = Maj(B, C, D);
|
|
421
|
+
K = 2400959708;
|
|
422
|
+
} else {
|
|
423
|
+
F = B ^ C ^ D;
|
|
424
|
+
K = 3395469782;
|
|
425
|
+
}
|
|
426
|
+
const T = rotl(A, 5) + F + E + K + SHA1_W[i] | 0;
|
|
427
|
+
E = D;
|
|
428
|
+
D = C;
|
|
429
|
+
C = rotl(B, 30);
|
|
430
|
+
B = A;
|
|
431
|
+
A = T;
|
|
432
|
+
}
|
|
433
|
+
A = A + this.A | 0;
|
|
434
|
+
B = B + this.B | 0;
|
|
435
|
+
C = C + this.C | 0;
|
|
436
|
+
D = D + this.D | 0;
|
|
437
|
+
E = E + this.E | 0;
|
|
438
|
+
this.set(A, B, C, D, E);
|
|
439
|
+
}
|
|
440
|
+
roundClean() {
|
|
441
|
+
clean(SHA1_W);
|
|
442
|
+
}
|
|
443
|
+
destroy() {
|
|
444
|
+
this.destroyed = true;
|
|
445
|
+
this.set(0, 0, 0, 0, 0);
|
|
446
|
+
clean(this.buffer);
|
|
447
|
+
}
|
|
448
|
+
};
|
|
449
|
+
const sha1 = /* @__PURE__ */ createHasher(() => new _SHA1());
|
|
450
|
+
const p32 = /* @__PURE__ */ Math.pow(2, 32);
|
|
451
|
+
const K = /* @__PURE__ */ Array.from({ length: 64 }, (_, i) => Math.floor(p32 * Math.abs(Math.sin(i + 1))));
|
|
452
|
+
const MD5_IV = /* @__PURE__ */ SHA1_IV.slice(0, 4);
|
|
453
|
+
const MD5_W = /* @__PURE__ */ new Uint32Array(16);
|
|
454
|
+
const MD5_SHIFTS = /* @__PURE__ */ (() => {
|
|
455
|
+
const S = [
|
|
456
|
+
[
|
|
457
|
+
7,
|
|
458
|
+
12,
|
|
459
|
+
17,
|
|
460
|
+
22
|
|
461
|
+
],
|
|
462
|
+
[
|
|
463
|
+
5,
|
|
464
|
+
9,
|
|
465
|
+
14,
|
|
466
|
+
20
|
|
467
|
+
],
|
|
468
|
+
[
|
|
469
|
+
4,
|
|
470
|
+
11,
|
|
471
|
+
16,
|
|
472
|
+
23
|
|
473
|
+
],
|
|
474
|
+
[
|
|
475
|
+
6,
|
|
476
|
+
10,
|
|
477
|
+
15,
|
|
478
|
+
21
|
|
479
|
+
]
|
|
480
|
+
];
|
|
481
|
+
return Uint8Array.from({ length: 64 }, (_, i) => S[Math.floor(i / 16)][i % 4]);
|
|
482
|
+
})();
|
|
483
|
+
var _MD5 = class extends HashMD {
|
|
484
|
+
A = MD5_IV[0] | 0;
|
|
485
|
+
B = MD5_IV[1] | 0;
|
|
486
|
+
C = MD5_IV[2] | 0;
|
|
487
|
+
D = MD5_IV[3] | 0;
|
|
488
|
+
constructor() {
|
|
489
|
+
super(64, 16, 8, true);
|
|
490
|
+
}
|
|
491
|
+
get() {
|
|
492
|
+
const { A, B, C, D } = this;
|
|
493
|
+
return [
|
|
494
|
+
A,
|
|
495
|
+
B,
|
|
496
|
+
C,
|
|
497
|
+
D
|
|
498
|
+
];
|
|
499
|
+
}
|
|
500
|
+
set(A, B, C, D) {
|
|
501
|
+
this.A = A | 0;
|
|
502
|
+
this.B = B | 0;
|
|
503
|
+
this.C = C | 0;
|
|
504
|
+
this.D = D | 0;
|
|
505
|
+
}
|
|
506
|
+
_cloneInto(to) {
|
|
507
|
+
(to ||= new this.constructor()).set(...this.get());
|
|
508
|
+
return this._cloneIntoMeta(to);
|
|
509
|
+
}
|
|
510
|
+
process(view, offset) {
|
|
511
|
+
for (let i = 0; i < 16; i++, offset += 4) MD5_W[i] = view.getUint32(offset, true);
|
|
512
|
+
let { A, B, C, D } = this;
|
|
513
|
+
for (let i = 0; i < 64; i++) {
|
|
514
|
+
let F, g;
|
|
515
|
+
if (i < 16) {
|
|
516
|
+
F = Chi(B, C, D);
|
|
517
|
+
g = i;
|
|
518
|
+
} else if (i < 32) {
|
|
519
|
+
F = Chi(D, B, C);
|
|
520
|
+
g = (5 * i + 1) % 16;
|
|
521
|
+
} else if (i < 48) {
|
|
522
|
+
F = B ^ C ^ D;
|
|
523
|
+
g = (3 * i + 5) % 16;
|
|
524
|
+
} else {
|
|
525
|
+
F = C ^ (B | ~D);
|
|
526
|
+
g = 7 * i % 16;
|
|
527
|
+
}
|
|
528
|
+
F = F + A + K[i] + MD5_W[g];
|
|
529
|
+
A = D;
|
|
530
|
+
D = C;
|
|
531
|
+
C = B;
|
|
532
|
+
B = B + rotl(F, MD5_SHIFTS[i]);
|
|
533
|
+
}
|
|
534
|
+
A = A + this.A | 0;
|
|
535
|
+
B = B + this.B | 0;
|
|
536
|
+
C = C + this.C | 0;
|
|
537
|
+
D = D + this.D | 0;
|
|
538
|
+
this.set(A, B, C, D);
|
|
539
|
+
}
|
|
540
|
+
roundClean() {
|
|
541
|
+
clean(MD5_W);
|
|
542
|
+
}
|
|
543
|
+
destroy() {
|
|
544
|
+
this.destroyed = true;
|
|
545
|
+
this.set(0, 0, 0, 0);
|
|
546
|
+
clean(this.buffer);
|
|
547
|
+
}
|
|
548
|
+
};
|
|
549
|
+
const md5 = /* @__PURE__ */ createHasher(() => new _MD5());
|
|
550
|
+
//#endregion
|
|
551
|
+
//#region ../../node_modules/.pnpm/@noble+hashes@2.4.0/node_modules/@noble/hashes/sha2.js
|
|
552
|
+
const SHA256_K = /* @__PURE__ */ Uint32Array.from([
|
|
553
|
+
1116352408,
|
|
554
|
+
1899447441,
|
|
555
|
+
3049323471,
|
|
556
|
+
3921009573,
|
|
557
|
+
961987163,
|
|
558
|
+
1508970993,
|
|
559
|
+
2453635748,
|
|
560
|
+
2870763221,
|
|
561
|
+
3624381080,
|
|
562
|
+
310598401,
|
|
563
|
+
607225278,
|
|
564
|
+
1426881987,
|
|
565
|
+
1925078388,
|
|
566
|
+
2162078206,
|
|
567
|
+
2614888103,
|
|
568
|
+
3248222580,
|
|
569
|
+
3835390401,
|
|
570
|
+
4022224774,
|
|
571
|
+
264347078,
|
|
572
|
+
604807628,
|
|
573
|
+
770255983,
|
|
574
|
+
1249150122,
|
|
575
|
+
1555081692,
|
|
576
|
+
1996064986,
|
|
577
|
+
2554220882,
|
|
578
|
+
2821834349,
|
|
579
|
+
2952996808,
|
|
580
|
+
3210313671,
|
|
581
|
+
3336571891,
|
|
582
|
+
3584528711,
|
|
583
|
+
113926993,
|
|
584
|
+
338241895,
|
|
585
|
+
666307205,
|
|
586
|
+
773529912,
|
|
587
|
+
1294757372,
|
|
588
|
+
1396182291,
|
|
589
|
+
1695183700,
|
|
590
|
+
1986661051,
|
|
591
|
+
2177026350,
|
|
592
|
+
2456956037,
|
|
593
|
+
2730485921,
|
|
594
|
+
2820302411,
|
|
595
|
+
3259730800,
|
|
596
|
+
3345764771,
|
|
597
|
+
3516065817,
|
|
598
|
+
3600352804,
|
|
599
|
+
4094571909,
|
|
600
|
+
275423344,
|
|
601
|
+
430227734,
|
|
602
|
+
506948616,
|
|
603
|
+
659060556,
|
|
604
|
+
883997877,
|
|
605
|
+
958139571,
|
|
606
|
+
1322822218,
|
|
607
|
+
1537002063,
|
|
608
|
+
1747873779,
|
|
609
|
+
1955562222,
|
|
610
|
+
2024104815,
|
|
611
|
+
2227730452,
|
|
612
|
+
2361852424,
|
|
613
|
+
2428436474,
|
|
614
|
+
2756734187,
|
|
615
|
+
3204031479,
|
|
616
|
+
3329325298
|
|
617
|
+
]);
|
|
618
|
+
const SHA256_W = /* @__PURE__ */ new Uint32Array(64);
|
|
619
|
+
var SHA2_32B = class extends HashMD {
|
|
620
|
+
A = 0;
|
|
621
|
+
B = 0;
|
|
622
|
+
C = 0;
|
|
623
|
+
D = 0;
|
|
624
|
+
E = 0;
|
|
625
|
+
F = 0;
|
|
626
|
+
G = 0;
|
|
627
|
+
H = 0;
|
|
628
|
+
constructor(outputLen, IV) {
|
|
629
|
+
super(64, outputLen, 8, false);
|
|
630
|
+
this.A = IV[0] | 0;
|
|
631
|
+
this.B = IV[1] | 0;
|
|
632
|
+
this.C = IV[2] | 0;
|
|
633
|
+
this.D = IV[3] | 0;
|
|
634
|
+
this.E = IV[4] | 0;
|
|
635
|
+
this.F = IV[5] | 0;
|
|
636
|
+
this.G = IV[6] | 0;
|
|
637
|
+
this.H = IV[7] | 0;
|
|
638
|
+
}
|
|
639
|
+
get() {
|
|
640
|
+
const { A, B, C, D, E, F, G, H } = this;
|
|
641
|
+
return [
|
|
642
|
+
A,
|
|
643
|
+
B,
|
|
644
|
+
C,
|
|
645
|
+
D,
|
|
646
|
+
E,
|
|
647
|
+
F,
|
|
648
|
+
G,
|
|
649
|
+
H
|
|
650
|
+
];
|
|
651
|
+
}
|
|
652
|
+
set(A, B, C, D, E, F, G, H) {
|
|
653
|
+
this.A = A | 0;
|
|
654
|
+
this.B = B | 0;
|
|
655
|
+
this.C = C | 0;
|
|
656
|
+
this.D = D | 0;
|
|
657
|
+
this.E = E | 0;
|
|
658
|
+
this.F = F | 0;
|
|
659
|
+
this.G = G | 0;
|
|
660
|
+
this.H = H | 0;
|
|
661
|
+
}
|
|
662
|
+
_cloneInto(to) {
|
|
663
|
+
(to ||= new this.constructor()).set(...this.get());
|
|
664
|
+
return this._cloneIntoMeta(to);
|
|
665
|
+
}
|
|
666
|
+
process(view, offset) {
|
|
667
|
+
for (let i = 0; i < 16; i++, offset += 4) SHA256_W[i] = view.getUint32(offset, false);
|
|
668
|
+
for (let i = 16; i < 64; i++) {
|
|
669
|
+
const W15 = SHA256_W[i - 15];
|
|
670
|
+
const W2 = SHA256_W[i - 2];
|
|
671
|
+
const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ W15 >>> 3;
|
|
672
|
+
const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ W2 >>> 10;
|
|
673
|
+
SHA256_W[i] = s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16] | 0;
|
|
674
|
+
}
|
|
675
|
+
let { A, B, C, D, E, F, G, H } = this;
|
|
676
|
+
for (let i = 0; i < 64; i++) {
|
|
677
|
+
const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);
|
|
678
|
+
const T1 = H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i] | 0;
|
|
679
|
+
const T2 = (rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22)) + Maj(A, B, C) | 0;
|
|
680
|
+
H = G;
|
|
681
|
+
G = F;
|
|
682
|
+
F = E;
|
|
683
|
+
E = D + T1 | 0;
|
|
684
|
+
D = C;
|
|
685
|
+
C = B;
|
|
686
|
+
B = A;
|
|
687
|
+
A = T1 + T2 | 0;
|
|
688
|
+
}
|
|
689
|
+
A = A + this.A | 0;
|
|
690
|
+
B = B + this.B | 0;
|
|
691
|
+
C = C + this.C | 0;
|
|
692
|
+
D = D + this.D | 0;
|
|
693
|
+
E = E + this.E | 0;
|
|
694
|
+
F = F + this.F | 0;
|
|
695
|
+
G = G + this.G | 0;
|
|
696
|
+
H = H + this.H | 0;
|
|
697
|
+
this.set(A, B, C, D, E, F, G, H);
|
|
698
|
+
}
|
|
699
|
+
roundClean() {
|
|
700
|
+
clean(SHA256_W);
|
|
701
|
+
}
|
|
702
|
+
destroy() {
|
|
703
|
+
this.destroyed = true;
|
|
704
|
+
this.set(0, 0, 0, 0, 0, 0, 0, 0);
|
|
705
|
+
clean(this.buffer);
|
|
706
|
+
}
|
|
707
|
+
};
|
|
708
|
+
var _SHA256 = class extends SHA2_32B {
|
|
709
|
+
constructor() {
|
|
710
|
+
super(32, SHA256_IV);
|
|
711
|
+
}
|
|
712
|
+
};
|
|
713
|
+
var _SHA224 = class extends SHA2_32B {
|
|
714
|
+
constructor() {
|
|
715
|
+
super(28, SHA224_IV);
|
|
716
|
+
}
|
|
717
|
+
};
|
|
718
|
+
const K512 = /* @__PURE__ */ (() => split([
|
|
719
|
+
"0x428a2f98d728ae22",
|
|
720
|
+
"0x7137449123ef65cd",
|
|
721
|
+
"0xb5c0fbcfec4d3b2f",
|
|
722
|
+
"0xe9b5dba58189dbbc",
|
|
723
|
+
"0x3956c25bf348b538",
|
|
724
|
+
"0x59f111f1b605d019",
|
|
725
|
+
"0x923f82a4af194f9b",
|
|
726
|
+
"0xab1c5ed5da6d8118",
|
|
727
|
+
"0xd807aa98a3030242",
|
|
728
|
+
"0x12835b0145706fbe",
|
|
729
|
+
"0x243185be4ee4b28c",
|
|
730
|
+
"0x550c7dc3d5ffb4e2",
|
|
731
|
+
"0x72be5d74f27b896f",
|
|
732
|
+
"0x80deb1fe3b1696b1",
|
|
733
|
+
"0x9bdc06a725c71235",
|
|
734
|
+
"0xc19bf174cf692694",
|
|
735
|
+
"0xe49b69c19ef14ad2",
|
|
736
|
+
"0xefbe4786384f25e3",
|
|
737
|
+
"0x0fc19dc68b8cd5b5",
|
|
738
|
+
"0x240ca1cc77ac9c65",
|
|
739
|
+
"0x2de92c6f592b0275",
|
|
740
|
+
"0x4a7484aa6ea6e483",
|
|
741
|
+
"0x5cb0a9dcbd41fbd4",
|
|
742
|
+
"0x76f988da831153b5",
|
|
743
|
+
"0x983e5152ee66dfab",
|
|
744
|
+
"0xa831c66d2db43210",
|
|
745
|
+
"0xb00327c898fb213f",
|
|
746
|
+
"0xbf597fc7beef0ee4",
|
|
747
|
+
"0xc6e00bf33da88fc2",
|
|
748
|
+
"0xd5a79147930aa725",
|
|
749
|
+
"0x06ca6351e003826f",
|
|
750
|
+
"0x142929670a0e6e70",
|
|
751
|
+
"0x27b70a8546d22ffc",
|
|
752
|
+
"0x2e1b21385c26c926",
|
|
753
|
+
"0x4d2c6dfc5ac42aed",
|
|
754
|
+
"0x53380d139d95b3df",
|
|
755
|
+
"0x650a73548baf63de",
|
|
756
|
+
"0x766a0abb3c77b2a8",
|
|
757
|
+
"0x81c2c92e47edaee6",
|
|
758
|
+
"0x92722c851482353b",
|
|
759
|
+
"0xa2bfe8a14cf10364",
|
|
760
|
+
"0xa81a664bbc423001",
|
|
761
|
+
"0xc24b8b70d0f89791",
|
|
762
|
+
"0xc76c51a30654be30",
|
|
763
|
+
"0xd192e819d6ef5218",
|
|
764
|
+
"0xd69906245565a910",
|
|
765
|
+
"0xf40e35855771202a",
|
|
766
|
+
"0x106aa07032bbd1b8",
|
|
767
|
+
"0x19a4c116b8d2d0c8",
|
|
768
|
+
"0x1e376c085141ab53",
|
|
769
|
+
"0x2748774cdf8eeb99",
|
|
770
|
+
"0x34b0bcb5e19b48a8",
|
|
771
|
+
"0x391c0cb3c5c95a63",
|
|
772
|
+
"0x4ed8aa4ae3418acb",
|
|
773
|
+
"0x5b9cca4f7763e373",
|
|
774
|
+
"0x682e6ff3d6b2b8a3",
|
|
775
|
+
"0x748f82ee5defb2fc",
|
|
776
|
+
"0x78a5636f43172f60",
|
|
777
|
+
"0x84c87814a1f0ab72",
|
|
778
|
+
"0x8cc702081a6439ec",
|
|
779
|
+
"0x90befffa23631e28",
|
|
780
|
+
"0xa4506cebde82bde9",
|
|
781
|
+
"0xbef9a3f7b2c67915",
|
|
782
|
+
"0xc67178f2e372532b",
|
|
783
|
+
"0xca273eceea26619c",
|
|
784
|
+
"0xd186b8c721c0c207",
|
|
785
|
+
"0xeada7dd6cde0eb1e",
|
|
786
|
+
"0xf57d4f7fee6ed178",
|
|
787
|
+
"0x06f067aa72176fba",
|
|
788
|
+
"0x0a637dc5a2c898a6",
|
|
789
|
+
"0x113f9804bef90dae",
|
|
790
|
+
"0x1b710b35131c471b",
|
|
791
|
+
"0x28db77f523047d84",
|
|
792
|
+
"0x32caab7b40c72493",
|
|
793
|
+
"0x3c9ebe0a15c9bebc",
|
|
794
|
+
"0x431d67c49c100d4c",
|
|
795
|
+
"0x4cc5d4becb3e42b6",
|
|
796
|
+
"0x597f299cfc657e2a",
|
|
797
|
+
"0x5fcb6fab3ad6faec",
|
|
798
|
+
"0x6c44198c4a475817"
|
|
799
|
+
].map((n) => BigInt(n))))();
|
|
800
|
+
const SHA512_Kh = /* @__PURE__ */ (() => K512[0])();
|
|
801
|
+
const SHA512_Kl = /* @__PURE__ */ (() => K512[1])();
|
|
802
|
+
const SHA512_W_H = /* @__PURE__ */ new Uint32Array(80);
|
|
803
|
+
const SHA512_W_L = /* @__PURE__ */ new Uint32Array(80);
|
|
804
|
+
var SHA2_64B = class extends HashMD {
|
|
805
|
+
Ah = 0;
|
|
806
|
+
Al = 0;
|
|
807
|
+
Bh = 0;
|
|
808
|
+
Bl = 0;
|
|
809
|
+
Ch = 0;
|
|
810
|
+
Cl = 0;
|
|
811
|
+
Dh = 0;
|
|
812
|
+
Dl = 0;
|
|
813
|
+
Eh = 0;
|
|
814
|
+
El = 0;
|
|
815
|
+
Fh = 0;
|
|
816
|
+
Fl = 0;
|
|
817
|
+
Gh = 0;
|
|
818
|
+
Gl = 0;
|
|
819
|
+
Hh = 0;
|
|
820
|
+
Hl = 0;
|
|
821
|
+
constructor(outputLen, IV) {
|
|
822
|
+
super(128, outputLen, 16, false);
|
|
823
|
+
this.Ah = IV[0] | 0;
|
|
824
|
+
this.Al = IV[1] | 0;
|
|
825
|
+
this.Bh = IV[2] | 0;
|
|
826
|
+
this.Bl = IV[3] | 0;
|
|
827
|
+
this.Ch = IV[4] | 0;
|
|
828
|
+
this.Cl = IV[5] | 0;
|
|
829
|
+
this.Dh = IV[6] | 0;
|
|
830
|
+
this.Dl = IV[7] | 0;
|
|
831
|
+
this.Eh = IV[8] | 0;
|
|
832
|
+
this.El = IV[9] | 0;
|
|
833
|
+
this.Fh = IV[10] | 0;
|
|
834
|
+
this.Fl = IV[11] | 0;
|
|
835
|
+
this.Gh = IV[12] | 0;
|
|
836
|
+
this.Gl = IV[13] | 0;
|
|
837
|
+
this.Hh = IV[14] | 0;
|
|
838
|
+
this.Hl = IV[15] | 0;
|
|
839
|
+
}
|
|
840
|
+
get() {
|
|
841
|
+
const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;
|
|
842
|
+
return [
|
|
843
|
+
Ah,
|
|
844
|
+
Al,
|
|
845
|
+
Bh,
|
|
846
|
+
Bl,
|
|
847
|
+
Ch,
|
|
848
|
+
Cl,
|
|
849
|
+
Dh,
|
|
850
|
+
Dl,
|
|
851
|
+
Eh,
|
|
852
|
+
El,
|
|
853
|
+
Fh,
|
|
854
|
+
Fl,
|
|
855
|
+
Gh,
|
|
856
|
+
Gl,
|
|
857
|
+
Hh,
|
|
858
|
+
Hl
|
|
859
|
+
];
|
|
860
|
+
}
|
|
861
|
+
set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) {
|
|
862
|
+
this.Ah = Ah | 0;
|
|
863
|
+
this.Al = Al | 0;
|
|
864
|
+
this.Bh = Bh | 0;
|
|
865
|
+
this.Bl = Bl | 0;
|
|
866
|
+
this.Ch = Ch | 0;
|
|
867
|
+
this.Cl = Cl | 0;
|
|
868
|
+
this.Dh = Dh | 0;
|
|
869
|
+
this.Dl = Dl | 0;
|
|
870
|
+
this.Eh = Eh | 0;
|
|
871
|
+
this.El = El | 0;
|
|
872
|
+
this.Fh = Fh | 0;
|
|
873
|
+
this.Fl = Fl | 0;
|
|
874
|
+
this.Gh = Gh | 0;
|
|
875
|
+
this.Gl = Gl | 0;
|
|
876
|
+
this.Hh = Hh | 0;
|
|
877
|
+
this.Hl = Hl | 0;
|
|
878
|
+
}
|
|
879
|
+
_cloneInto(to) {
|
|
880
|
+
(to ||= new this.constructor()).set(...this.get());
|
|
881
|
+
return this._cloneIntoMeta(to);
|
|
882
|
+
}
|
|
883
|
+
process(view, offset) {
|
|
884
|
+
for (let i = 0; i < 16; i++, offset += 4) {
|
|
885
|
+
SHA512_W_H[i] = view.getUint32(offset);
|
|
886
|
+
SHA512_W_L[i] = view.getUint32(offset += 4);
|
|
887
|
+
}
|
|
888
|
+
for (let i = 16; i < 80; i++) {
|
|
889
|
+
const W15h = SHA512_W_H[i - 15] | 0;
|
|
890
|
+
const W15l = SHA512_W_L[i - 15] | 0;
|
|
891
|
+
const s0h = rotrSH(W15h, W15l, 1) ^ rotrSH(W15h, W15l, 8) ^ shrSH(W15h, W15l, 7);
|
|
892
|
+
const s0l = rotrSL(W15h, W15l, 1) ^ rotrSL(W15h, W15l, 8) ^ shrSL(W15h, W15l, 7);
|
|
893
|
+
const W2h = SHA512_W_H[i - 2] | 0;
|
|
894
|
+
const W2l = SHA512_W_L[i - 2] | 0;
|
|
895
|
+
const s1h = rotrSH(W2h, W2l, 19) ^ rotrBH(W2h, W2l, 61) ^ shrSH(W2h, W2l, 6);
|
|
896
|
+
const s1l = rotrSL(W2h, W2l, 19) ^ rotrBL(W2h, W2l, 61) ^ shrSL(W2h, W2l, 6);
|
|
897
|
+
const SUMl = add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);
|
|
898
|
+
const SUMh = add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);
|
|
899
|
+
SHA512_W_H[i] = SUMh | 0;
|
|
900
|
+
SHA512_W_L[i] = SUMl | 0;
|
|
901
|
+
}
|
|
902
|
+
let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;
|
|
903
|
+
for (let i = 0; i < 80; i++) {
|
|
904
|
+
const sigma1h = rotrSH(Eh, El, 14) ^ rotrSH(Eh, El, 18) ^ rotrBH(Eh, El, 41);
|
|
905
|
+
const sigma1l = rotrSL(Eh, El, 14) ^ rotrSL(Eh, El, 18) ^ rotrBL(Eh, El, 41);
|
|
906
|
+
const CHIh = Eh & Fh ^ ~Eh & Gh;
|
|
907
|
+
const CHIl = El & Fl ^ ~El & Gl;
|
|
908
|
+
const T1ll = add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);
|
|
909
|
+
const T1h = add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);
|
|
910
|
+
const T1l = T1ll | 0;
|
|
911
|
+
const sigma0h = rotrSH(Ah, Al, 28) ^ rotrBH(Ah, Al, 34) ^ rotrBH(Ah, Al, 39);
|
|
912
|
+
const sigma0l = rotrSL(Ah, Al, 28) ^ rotrBL(Ah, Al, 34) ^ rotrBL(Ah, Al, 39);
|
|
913
|
+
const MAJh = Ah & Bh ^ Ah & Ch ^ Bh & Ch;
|
|
914
|
+
const MAJl = Al & Bl ^ Al & Cl ^ Bl & Cl;
|
|
915
|
+
Hh = Gh | 0;
|
|
916
|
+
Hl = Gl | 0;
|
|
917
|
+
Gh = Fh | 0;
|
|
918
|
+
Gl = Fl | 0;
|
|
919
|
+
Fh = Eh | 0;
|
|
920
|
+
Fl = El | 0;
|
|
921
|
+
({h: Eh, l: El} = add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));
|
|
922
|
+
Dh = Ch | 0;
|
|
923
|
+
Dl = Cl | 0;
|
|
924
|
+
Ch = Bh | 0;
|
|
925
|
+
Cl = Bl | 0;
|
|
926
|
+
Bh = Ah | 0;
|
|
927
|
+
Bl = Al | 0;
|
|
928
|
+
const All = add3L(T1l, sigma0l, MAJl);
|
|
929
|
+
Ah = add3H(All, T1h, sigma0h, MAJh);
|
|
930
|
+
Al = All | 0;
|
|
931
|
+
}
|
|
932
|
+
({h: Ah, l: Al} = add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));
|
|
933
|
+
({h: Bh, l: Bl} = add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));
|
|
934
|
+
({h: Ch, l: Cl} = add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));
|
|
935
|
+
({h: Dh, l: Dl} = add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));
|
|
936
|
+
({h: Eh, l: El} = add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));
|
|
937
|
+
({h: Fh, l: Fl} = add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));
|
|
938
|
+
({h: Gh, l: Gl} = add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));
|
|
939
|
+
({h: Hh, l: Hl} = add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));
|
|
940
|
+
this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl);
|
|
941
|
+
}
|
|
942
|
+
roundClean() {
|
|
943
|
+
clean(SHA512_W_H, SHA512_W_L);
|
|
944
|
+
}
|
|
945
|
+
destroy() {
|
|
946
|
+
this.destroyed = true;
|
|
947
|
+
clean(this.buffer);
|
|
948
|
+
this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
949
|
+
}
|
|
950
|
+
};
|
|
951
|
+
var _SHA512 = class extends SHA2_64B {
|
|
952
|
+
constructor() {
|
|
953
|
+
super(64, SHA512_IV);
|
|
954
|
+
}
|
|
955
|
+
};
|
|
956
|
+
var _SHA384 = class extends SHA2_64B {
|
|
957
|
+
constructor() {
|
|
958
|
+
super(48, SHA384_IV);
|
|
959
|
+
}
|
|
960
|
+
};
|
|
961
|
+
const sha256 = /* @__PURE__ */ createHasher(() => new _SHA256(), /* @__PURE__ */ oidNist(1));
|
|
962
|
+
const sha224 = /* @__PURE__ */ createHasher(() => new _SHA224(), /* @__PURE__ */ oidNist(4));
|
|
963
|
+
const sha512 = /* @__PURE__ */ createHasher(() => new _SHA512(), /* @__PURE__ */ oidNist(3));
|
|
964
|
+
const sha384 = /* @__PURE__ */ createHasher(() => new _SHA384(), /* @__PURE__ */ oidNist(2));
|
|
965
|
+
//#endregion
|
|
966
|
+
//#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/node/internal/crypto/web.mjs
|
|
967
|
+
const subtle$1 = globalThis.crypto?.subtle;
|
|
968
|
+
const randomUUID$1 = () => {
|
|
969
|
+
return globalThis.crypto?.randomUUID();
|
|
970
|
+
};
|
|
971
|
+
const getRandomValues$1 = (array) => {
|
|
972
|
+
return globalThis.crypto?.getRandomValues(array);
|
|
973
|
+
};
|
|
974
|
+
//#endregion
|
|
975
|
+
//#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/_internal/utils.mjs
|
|
976
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
977
|
+
function createNotImplementedError(name) {
|
|
978
|
+
return /* @__PURE__ */ new Error(`[unenv] ${name} is not implemented yet!`);
|
|
979
|
+
}
|
|
980
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
981
|
+
function notImplemented(name) {
|
|
982
|
+
const fn = () => {
|
|
983
|
+
throw /* @__PURE__ */ createNotImplementedError(name);
|
|
984
|
+
};
|
|
985
|
+
return Object.assign(fn, { __unenv__: true });
|
|
986
|
+
}
|
|
987
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
988
|
+
function notImplementedClass(name) {
|
|
989
|
+
return class {
|
|
990
|
+
__unenv__ = true;
|
|
991
|
+
constructor() {
|
|
992
|
+
throw new Error(`[unenv] ${name} is not implemented yet!`);
|
|
993
|
+
}
|
|
994
|
+
};
|
|
995
|
+
}
|
|
996
|
+
//#endregion
|
|
997
|
+
//#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/node/internal/crypto/node.mjs
|
|
998
|
+
const MAX_RANDOM_VALUE_BYTES = 65536;
|
|
999
|
+
const webcrypto$1 = new Proxy(globalThis.crypto, { get(_, key) {
|
|
1000
|
+
if (key === "CryptoKey") return globalThis.CryptoKey;
|
|
1001
|
+
if (typeof globalThis.crypto[key] === "function") return globalThis.crypto[key].bind(globalThis.crypto);
|
|
1002
|
+
return globalThis.crypto[key];
|
|
1003
|
+
} });
|
|
1004
|
+
const randomBytes$1 = (size, cb) => {
|
|
1005
|
+
const bytes = Buffer.alloc(size, 0, void 0);
|
|
1006
|
+
for (let generated = 0; generated < size; generated += MAX_RANDOM_VALUE_BYTES) getRandomValues$1(Uint8Array.prototype.subarray.call(bytes, generated, generated + MAX_RANDOM_VALUE_BYTES));
|
|
1007
|
+
if (typeof cb === "function") {
|
|
1008
|
+
cb(null, bytes);
|
|
1009
|
+
return;
|
|
1010
|
+
}
|
|
1011
|
+
return bytes;
|
|
1012
|
+
};
|
|
1013
|
+
const rng = randomBytes$1;
|
|
1014
|
+
const prng = randomBytes$1;
|
|
1015
|
+
const fips = false;
|
|
1016
|
+
const checkPrime = /* @__PURE__ */ notImplemented("crypto.checkPrime");
|
|
1017
|
+
const checkPrimeSync = /* @__PURE__ */ notImplemented("crypto.checkPrimeSync");
|
|
1018
|
+
const createCipher = void 0;
|
|
1019
|
+
const createDecipher = void 0;
|
|
1020
|
+
const pseudoRandomBytes = /* @__PURE__ */ notImplemented("crypto.pseudoRandomBytes");
|
|
1021
|
+
const createCipheriv = /* @__PURE__ */ notImplemented("crypto.createCipheriv");
|
|
1022
|
+
const createDecipheriv = /* @__PURE__ */ notImplemented("crypto.createDecipheriv");
|
|
1023
|
+
const createDiffieHellman = /* @__PURE__ */ notImplemented("crypto.createDiffieHellman");
|
|
1024
|
+
const createDiffieHellmanGroup = /* @__PURE__ */ notImplemented("crypto.createDiffieHellmanGroup");
|
|
1025
|
+
const createECDH = /* @__PURE__ */ notImplemented("crypto.createECDH");
|
|
1026
|
+
const createHash$1 = /* @__PURE__ */ notImplemented("crypto.createHash");
|
|
1027
|
+
const createHmac$1 = /* @__PURE__ */ notImplemented("crypto.createHmac");
|
|
1028
|
+
const createPrivateKey = /* @__PURE__ */ notImplemented("crypto.createPrivateKey");
|
|
1029
|
+
const createPublicKey = /* @__PURE__ */ notImplemented("crypto.createPublicKey");
|
|
1030
|
+
const createSecretKey = /* @__PURE__ */ notImplemented("crypto.createSecretKey");
|
|
1031
|
+
const createSign = /* @__PURE__ */ notImplemented("crypto.createSign");
|
|
1032
|
+
const createVerify = /* @__PURE__ */ notImplemented("crypto.createVerify");
|
|
1033
|
+
const diffieHellman = /* @__PURE__ */ notImplemented("crypto.diffieHellman");
|
|
1034
|
+
const generatePrime = /* @__PURE__ */ notImplemented("crypto.generatePrime");
|
|
1035
|
+
const generatePrimeSync = /* @__PURE__ */ notImplemented("crypto.generatePrimeSync");
|
|
1036
|
+
const getCiphers = /* @__PURE__ */ notImplemented("crypto.getCiphers");
|
|
1037
|
+
const getCipherInfo = /* @__PURE__ */ notImplemented("crypto.getCipherInfo");
|
|
1038
|
+
const getCurves = /* @__PURE__ */ notImplemented("crypto.getCurves");
|
|
1039
|
+
const getDiffieHellman = /* @__PURE__ */ notImplemented("crypto.getDiffieHellman");
|
|
1040
|
+
const getHashes$1 = /* @__PURE__ */ notImplemented("crypto.getHashes");
|
|
1041
|
+
const hkdf = /* @__PURE__ */ notImplemented("crypto.hkdf");
|
|
1042
|
+
const hkdfSync = /* @__PURE__ */ notImplemented("crypto.hkdfSync");
|
|
1043
|
+
const pbkdf2 = /* @__PURE__ */ notImplemented("crypto.pbkdf2");
|
|
1044
|
+
const pbkdf2Sync = /* @__PURE__ */ notImplemented("crypto.pbkdf2Sync");
|
|
1045
|
+
const generateKeyPair = /* @__PURE__ */ notImplemented("crypto.generateKeyPair");
|
|
1046
|
+
const generateKeyPairSync = /* @__PURE__ */ notImplemented("crypto.generateKeyPairSync");
|
|
1047
|
+
const generateKey = /* @__PURE__ */ notImplemented("crypto.generateKey");
|
|
1048
|
+
const generateKeySync = /* @__PURE__ */ notImplemented("crypto.generateKeySync");
|
|
1049
|
+
const privateDecrypt = /* @__PURE__ */ notImplemented("crypto.privateDecrypt");
|
|
1050
|
+
const privateEncrypt = /* @__PURE__ */ notImplemented("crypto.privateEncrypt");
|
|
1051
|
+
const publicDecrypt = /* @__PURE__ */ notImplemented("crypto.publicDecrypt");
|
|
1052
|
+
const publicEncrypt = /* @__PURE__ */ notImplemented("crypto.publicEncrypt");
|
|
1053
|
+
const randomFill$1 = /* @__PURE__ */ notImplemented("crypto.randomFill");
|
|
1054
|
+
const randomFillSync$1 = /* @__PURE__ */ notImplemented("crypto.randomFillSync");
|
|
1055
|
+
const randomInt$1 = /* @__PURE__ */ notImplemented("crypto.randomInt");
|
|
1056
|
+
const scrypt = /* @__PURE__ */ notImplemented("crypto.scrypt");
|
|
1057
|
+
const scryptSync = /* @__PURE__ */ notImplemented("crypto.scryptSync");
|
|
1058
|
+
const sign = /* @__PURE__ */ notImplemented("crypto.sign");
|
|
1059
|
+
const setEngine = /* @__PURE__ */ notImplemented("crypto.setEngine");
|
|
1060
|
+
const timingSafeEqual$1 = /* @__PURE__ */ notImplemented("crypto.timingSafeEqual");
|
|
1061
|
+
const getFips = /* @__PURE__ */ notImplemented("crypto.getFips");
|
|
1062
|
+
const setFips = /* @__PURE__ */ notImplemented("crypto.setFips");
|
|
1063
|
+
const verify = /* @__PURE__ */ notImplemented("crypto.verify");
|
|
1064
|
+
const secureHeapUsed = /* @__PURE__ */ notImplemented("crypto.secureHeapUsed");
|
|
1065
|
+
const hash$1 = /* @__PURE__ */ notImplemented("crypto.hash");
|
|
1066
|
+
const Cipher = void 0;
|
|
1067
|
+
const Decipher = void 0;
|
|
1068
|
+
const Certificate = /* @__PURE__ */ notImplementedClass("crypto.Certificate");
|
|
1069
|
+
const Cipheriv = /* @__PURE__ */ notImplementedClass("crypto.Cipheriv");
|
|
1070
|
+
const Decipheriv = /* @__PURE__ */ notImplementedClass("crypto.Decipheriv");
|
|
1071
|
+
const DiffieHellman = /* @__PURE__ */ notImplementedClass("crypto.DiffieHellman");
|
|
1072
|
+
const DiffieHellmanGroup = /* @__PURE__ */ notImplementedClass("crypto.DiffieHellmanGroup");
|
|
1073
|
+
const ECDH = /* @__PURE__ */ notImplementedClass("crypto.ECDH");
|
|
1074
|
+
const Hash$1 = /* @__PURE__ */ notImplementedClass("crypto.Hash");
|
|
1075
|
+
const Hmac$1 = /* @__PURE__ */ notImplementedClass("crypto.Hmac");
|
|
1076
|
+
const KeyObject = /* @__PURE__ */ notImplementedClass("crypto.KeyObject");
|
|
1077
|
+
const Sign = /* @__PURE__ */ notImplementedClass("crypto.Sign");
|
|
1078
|
+
const Verify = /* @__PURE__ */ notImplementedClass("crypto.Verify");
|
|
1079
|
+
const X509Certificate = /* @__PURE__ */ notImplementedClass("crypto.X509Certificate");
|
|
1080
|
+
//#endregion
|
|
1081
|
+
//#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/node/crypto.mjs
|
|
1082
|
+
const constants = {
|
|
1083
|
+
OPENSSL_VERSION_NUMBER: 0,
|
|
1084
|
+
SSL_OP_ALL: 2147485776,
|
|
1085
|
+
SSL_OP_ALLOW_NO_DHE_KEX: 1024,
|
|
1086
|
+
SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: 262144,
|
|
1087
|
+
SSL_OP_CIPHER_SERVER_PREFERENCE: 4194304,
|
|
1088
|
+
SSL_OP_CISCO_ANYCONNECT: 32768,
|
|
1089
|
+
SSL_OP_COOKIE_EXCHANGE: 8192,
|
|
1090
|
+
SSL_OP_CRYPTOPRO_TLSEXT_BUG: 2147483648,
|
|
1091
|
+
SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: 2048,
|
|
1092
|
+
SSL_OP_LEGACY_SERVER_CONNECT: 4,
|
|
1093
|
+
SSL_OP_NO_COMPRESSION: 131072,
|
|
1094
|
+
SSL_OP_NO_ENCRYPT_THEN_MAC: 524288,
|
|
1095
|
+
SSL_OP_NO_QUERY_MTU: 4096,
|
|
1096
|
+
SSL_OP_NO_RENEGOTIATION: 1073741824,
|
|
1097
|
+
SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: 65536,
|
|
1098
|
+
SSL_OP_NO_SSLv2: 0,
|
|
1099
|
+
SSL_OP_NO_SSLv3: 33554432,
|
|
1100
|
+
SSL_OP_NO_TICKET: 16384,
|
|
1101
|
+
SSL_OP_NO_TLSv1: 67108864,
|
|
1102
|
+
SSL_OP_NO_TLSv1_1: 268435456,
|
|
1103
|
+
SSL_OP_NO_TLSv1_2: 134217728,
|
|
1104
|
+
SSL_OP_NO_TLSv1_3: 536870912,
|
|
1105
|
+
SSL_OP_PRIORITIZE_CHACHA: 2097152,
|
|
1106
|
+
SSL_OP_TLS_ROLLBACK_BUG: 8388608,
|
|
1107
|
+
ENGINE_METHOD_RSA: 1,
|
|
1108
|
+
ENGINE_METHOD_DSA: 2,
|
|
1109
|
+
ENGINE_METHOD_DH: 4,
|
|
1110
|
+
ENGINE_METHOD_RAND: 8,
|
|
1111
|
+
ENGINE_METHOD_EC: 2048,
|
|
1112
|
+
ENGINE_METHOD_CIPHERS: 64,
|
|
1113
|
+
ENGINE_METHOD_DIGESTS: 128,
|
|
1114
|
+
ENGINE_METHOD_PKEY_METHS: 512,
|
|
1115
|
+
ENGINE_METHOD_PKEY_ASN1_METHS: 1024,
|
|
1116
|
+
ENGINE_METHOD_ALL: 65535,
|
|
1117
|
+
ENGINE_METHOD_NONE: 0,
|
|
1118
|
+
DH_CHECK_P_NOT_SAFE_PRIME: 2,
|
|
1119
|
+
DH_CHECK_P_NOT_PRIME: 1,
|
|
1120
|
+
DH_UNABLE_TO_CHECK_GENERATOR: 4,
|
|
1121
|
+
DH_NOT_SUITABLE_GENERATOR: 8,
|
|
1122
|
+
RSA_PKCS1_PADDING: 1,
|
|
1123
|
+
RSA_NO_PADDING: 3,
|
|
1124
|
+
RSA_PKCS1_OAEP_PADDING: 4,
|
|
1125
|
+
RSA_X931_PADDING: 5,
|
|
1126
|
+
RSA_PKCS1_PSS_PADDING: 6,
|
|
1127
|
+
RSA_PSS_SALTLEN_DIGEST: -1,
|
|
1128
|
+
RSA_PSS_SALTLEN_MAX_SIGN: -2,
|
|
1129
|
+
RSA_PSS_SALTLEN_AUTO: -2,
|
|
1130
|
+
defaultCoreCipherList: "",
|
|
1131
|
+
TLS1_VERSION: 0,
|
|
1132
|
+
TLS1_1_VERSION: 0,
|
|
1133
|
+
TLS1_2_VERSION: 0,
|
|
1134
|
+
TLS1_3_VERSION: 0,
|
|
1135
|
+
POINT_CONVERSION_COMPRESSED: 2,
|
|
1136
|
+
POINT_CONVERSION_UNCOMPRESSED: 4,
|
|
1137
|
+
POINT_CONVERSION_HYBRID: 6,
|
|
1138
|
+
defaultCipherList: ""
|
|
1139
|
+
};
|
|
1140
|
+
var crypto_default$1 = {
|
|
1141
|
+
constants,
|
|
1142
|
+
getRandomValues: getRandomValues$1,
|
|
1143
|
+
randomUUID: randomUUID$1,
|
|
1144
|
+
subtle: subtle$1,
|
|
1145
|
+
Certificate,
|
|
1146
|
+
Cipher: void 0,
|
|
1147
|
+
Cipheriv,
|
|
1148
|
+
Decipher: void 0,
|
|
1149
|
+
Decipheriv,
|
|
1150
|
+
DiffieHellman,
|
|
1151
|
+
DiffieHellmanGroup,
|
|
1152
|
+
ECDH,
|
|
1153
|
+
Hash: Hash$1,
|
|
1154
|
+
Hmac: Hmac$1,
|
|
1155
|
+
KeyObject,
|
|
1156
|
+
Sign,
|
|
1157
|
+
Verify,
|
|
1158
|
+
X509Certificate,
|
|
1159
|
+
checkPrime,
|
|
1160
|
+
checkPrimeSync,
|
|
1161
|
+
createCipheriv,
|
|
1162
|
+
createDecipheriv,
|
|
1163
|
+
createDiffieHellman,
|
|
1164
|
+
createDiffieHellmanGroup,
|
|
1165
|
+
createECDH,
|
|
1166
|
+
createHash: createHash$1,
|
|
1167
|
+
createHmac: createHmac$1,
|
|
1168
|
+
createPrivateKey,
|
|
1169
|
+
createPublicKey,
|
|
1170
|
+
createSecretKey,
|
|
1171
|
+
createSign,
|
|
1172
|
+
createVerify,
|
|
1173
|
+
diffieHellman,
|
|
1174
|
+
fips: false,
|
|
1175
|
+
generateKey,
|
|
1176
|
+
generateKeyPair,
|
|
1177
|
+
generateKeyPairSync,
|
|
1178
|
+
generateKeySync,
|
|
1179
|
+
generatePrime,
|
|
1180
|
+
generatePrimeSync,
|
|
1181
|
+
getCipherInfo,
|
|
1182
|
+
getCiphers,
|
|
1183
|
+
getCurves,
|
|
1184
|
+
getDiffieHellman,
|
|
1185
|
+
getFips,
|
|
1186
|
+
getHashes: getHashes$1,
|
|
1187
|
+
hash: hash$1,
|
|
1188
|
+
hkdf,
|
|
1189
|
+
hkdfSync,
|
|
1190
|
+
pbkdf2,
|
|
1191
|
+
pbkdf2Sync,
|
|
1192
|
+
privateDecrypt,
|
|
1193
|
+
privateEncrypt,
|
|
1194
|
+
pseudoRandomBytes,
|
|
1195
|
+
publicDecrypt,
|
|
1196
|
+
prng,
|
|
1197
|
+
publicEncrypt,
|
|
1198
|
+
randomBytes: randomBytes$1,
|
|
1199
|
+
randomFill: randomFill$1,
|
|
1200
|
+
randomFillSync: randomFillSync$1,
|
|
1201
|
+
randomInt: randomInt$1,
|
|
1202
|
+
rng,
|
|
1203
|
+
scrypt,
|
|
1204
|
+
scryptSync,
|
|
1205
|
+
secureHeapUsed,
|
|
1206
|
+
setEngine,
|
|
1207
|
+
setFips,
|
|
1208
|
+
sign,
|
|
1209
|
+
timingSafeEqual: timingSafeEqual$1,
|
|
1210
|
+
verify,
|
|
1211
|
+
webcrypto: webcrypto$1
|
|
1212
|
+
};
|
|
1213
|
+
//#endregion
|
|
1214
|
+
//#region src/node/crypto.ts
|
|
1215
|
+
const Buffer$2 = Buffer$1;
|
|
1216
|
+
const Transform$1 = Transform;
|
|
1217
|
+
const web = globalThis.crypto;
|
|
1218
|
+
const webcrypto = web;
|
|
1219
|
+
const subtle = web.subtle;
|
|
1220
|
+
const randomUUID = () => web.randomUUID();
|
|
1221
|
+
const getRandomValues = (view) => web.getRandomValues(view);
|
|
1222
|
+
const codeError = (error, code) => Object.assign(error, { code });
|
|
1223
|
+
const invalidType = (message) => codeError(new TypeError(message), "ERR_INVALID_ARG_TYPE");
|
|
1224
|
+
function callbackOf(callback) {
|
|
1225
|
+
if (typeof callback !== "function") throw invalidType("The \"callback\" argument must be of type function");
|
|
1226
|
+
return callback;
|
|
1227
|
+
}
|
|
1228
|
+
const outOfRange = (name, range, received) => codeError(/* @__PURE__ */ new RangeError(`The value of "${name}" is out of range. It must be ${range}. Received ${Math.abs(received) > 2 ** 32 ? String(received).replace(/\B(?=(\d{3})+$)/g, "_") : received}`), "ERR_OUT_OF_RANGE");
|
|
1229
|
+
function fill(view, offset = 0, size) {
|
|
1230
|
+
if (!(view instanceof ArrayBuffer) && !ArrayBuffer.isView(view)) throw invalidType("The \"buf\" argument must be an instance of ArrayBuffer or ArrayBufferView");
|
|
1231
|
+
const element = view.BYTES_PER_ELEMENT ?? 1;
|
|
1232
|
+
const whole = view instanceof ArrayBuffer ? new Uint8Array(view) : new Uint8Array(view.buffer, view.byteOffset, view.byteLength);
|
|
1233
|
+
const start = offset * element;
|
|
1234
|
+
if (!Number.isInteger(offset) || start < 0 || start > whole.length) throw outOfRange("offset", `>= 0 && <= ${whole.length}`, start);
|
|
1235
|
+
const end = size === void 0 ? whole.length : start + size * element;
|
|
1236
|
+
if (!Number.isInteger(size ?? 0) || end < start || end > whole.length) throw outOfRange("size + offset", `<= ${whole.length}`, end);
|
|
1237
|
+
for (let at = start; at < end; at += 65536) web.getRandomValues(whole.subarray(at, Math.min(at + 65536, end)));
|
|
1238
|
+
return view;
|
|
1239
|
+
}
|
|
1240
|
+
const randomFillSync = (view, offset, size) => fill(view, offset, size);
|
|
1241
|
+
function randomFill(view, ...rest) {
|
|
1242
|
+
const callback = callbackOf(rest.pop());
|
|
1243
|
+
const filled = fill(view, ...rest);
|
|
1244
|
+
setTimeout(() => callback(null, filled));
|
|
1245
|
+
}
|
|
1246
|
+
function randomBytes(size, callback) {
|
|
1247
|
+
const done = callback === void 0 ? void 0 : callbackOf(callback);
|
|
1248
|
+
const bytes = fill(Buffer$2.alloc(size));
|
|
1249
|
+
if (!done) return bytes;
|
|
1250
|
+
setTimeout(() => done(null, bytes));
|
|
1251
|
+
}
|
|
1252
|
+
function randomInt(...args) {
|
|
1253
|
+
const callback = typeof args.at(-1) === "function" ? args.pop() : void 0;
|
|
1254
|
+
const [min, max] = args.length === 1 ? [0, args[0]] : args;
|
|
1255
|
+
for (const [name, value] of [["min", min], ["max", max]]) if (!Number.isSafeInteger(value)) throw invalidType(`The "${name}" argument must be a safe integer`);
|
|
1256
|
+
if (max <= min) throw codeError(/* @__PURE__ */ new RangeError(`The value of "max" is out of range. It must be greater than the value of "min" (${min}). Received ${max}`), "ERR_OUT_OF_RANGE");
|
|
1257
|
+
const range = max - min;
|
|
1258
|
+
if (range > 2 ** 48 - 1) throw outOfRange(args.length === 1 ? "max" : "max - min", `<= ${2 ** 48 - 1}`, range);
|
|
1259
|
+
const limit = 2 ** 48 - 2 ** 48 % range;
|
|
1260
|
+
let value;
|
|
1261
|
+
do
|
|
1262
|
+
value = web.getRandomValues(/* @__PURE__ */ new Uint8Array(6)).reduce((total, byte) => total * 256 + byte, 0);
|
|
1263
|
+
while (value >= limit);
|
|
1264
|
+
const result = min + value % range;
|
|
1265
|
+
if (!callback) return result;
|
|
1266
|
+
setTimeout(() => callback(null, result));
|
|
1267
|
+
}
|
|
1268
|
+
function bytesOf(data, encoding) {
|
|
1269
|
+
if (typeof data === "string" && encoding === "hex" && data.length % 2 === 1) throw codeError(/* @__PURE__ */ new TypeError(`The argument 'encoding' is invalid for data of length ${data.length}. Received 'hex'`), "ERR_INVALID_ARG_VALUE");
|
|
1270
|
+
if (typeof data === "string") return Buffer$2.from(data, encoding ?? "utf8");
|
|
1271
|
+
if (data instanceof ArrayBuffer) return new Uint8Array(data);
|
|
1272
|
+
if (ArrayBuffer.isView(data)) return new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
|
|
1273
|
+
throw invalidType("The \"data\" argument must be of type string or an instance of Buffer, TypedArray, or DataView");
|
|
1274
|
+
}
|
|
1275
|
+
const output = (bytes, encoding) => {
|
|
1276
|
+
const buffer = Buffer$2.from(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
1277
|
+
return encoding && encoding !== "buffer" ? buffer.toString(encoding) : buffer;
|
|
1278
|
+
};
|
|
1279
|
+
const hashers = {
|
|
1280
|
+
md5,
|
|
1281
|
+
sha1,
|
|
1282
|
+
sha224,
|
|
1283
|
+
sha256,
|
|
1284
|
+
sha384,
|
|
1285
|
+
sha512
|
|
1286
|
+
};
|
|
1287
|
+
const getHashes = () => Object.keys(hashers);
|
|
1288
|
+
function hasherOf(algorithm, use) {
|
|
1289
|
+
const name = String(algorithm).toLowerCase().replace(/^rsa-/, "").replace(/^sha-(1|224|256|384|512)$/, "sha$1");
|
|
1290
|
+
const hasher = Object.hasOwn(hashers, name) ? hashers[name] : void 0;
|
|
1291
|
+
if (hasher) return hasher;
|
|
1292
|
+
if (use === "hash") throw new Error("Digest method not supported");
|
|
1293
|
+
if (use === "one-shot") throw new Error(`Digest method ${algorithm} is not supported`);
|
|
1294
|
+
throw codeError(/* @__PURE__ */ new TypeError(`Invalid digest: ${algorithm}`), "ERR_CRYPTO_INVALID_DIGEST");
|
|
1295
|
+
}
|
|
1296
|
+
const finalized = () => codeError(/* @__PURE__ */ new Error("Digest already called"), "ERR_CRYPTO_HASH_FINALIZED");
|
|
1297
|
+
var Digest = class extends Transform$1 {
|
|
1298
|
+
#state;
|
|
1299
|
+
#result;
|
|
1300
|
+
#digested = false;
|
|
1301
|
+
#again;
|
|
1302
|
+
constructor(state, again, options) {
|
|
1303
|
+
super(options);
|
|
1304
|
+
this.#state = state;
|
|
1305
|
+
this.#again = again;
|
|
1306
|
+
}
|
|
1307
|
+
#compute() {
|
|
1308
|
+
return this.#result ??= this.#state.digest();
|
|
1309
|
+
}
|
|
1310
|
+
get state() {
|
|
1311
|
+
if (this.#digested || this.#result) throw finalized();
|
|
1312
|
+
return this.#state;
|
|
1313
|
+
}
|
|
1314
|
+
update(data, encoding) {
|
|
1315
|
+
this.state.update(bytesOf(data, encoding));
|
|
1316
|
+
return this;
|
|
1317
|
+
}
|
|
1318
|
+
digest(encoding) {
|
|
1319
|
+
if (this.#digested) return output(this.#again(), encoding);
|
|
1320
|
+
this.#digested = true;
|
|
1321
|
+
return output(Uint8Array.from(this.#compute()), encoding);
|
|
1322
|
+
}
|
|
1323
|
+
_transform(chunk, _encoding, callback) {
|
|
1324
|
+
try {
|
|
1325
|
+
this.update(chunk);
|
|
1326
|
+
} catch (error) {
|
|
1327
|
+
callback(error);
|
|
1328
|
+
return;
|
|
1329
|
+
}
|
|
1330
|
+
callback();
|
|
1331
|
+
}
|
|
1332
|
+
_flush(callback) {
|
|
1333
|
+
this.push(Buffer$2.from(this.#compute()));
|
|
1334
|
+
callback();
|
|
1335
|
+
}
|
|
1336
|
+
};
|
|
1337
|
+
var Hash = class Hash extends Digest {
|
|
1338
|
+
constructor(algorithm, options) {
|
|
1339
|
+
if (typeof algorithm !== "string" && typeof algorithm?.clone !== "function") throw invalidType("The \"algorithm\" argument must be of type string");
|
|
1340
|
+
const state = typeof algorithm === "string" ? hasherOf(algorithm, "hash").create() : algorithm;
|
|
1341
|
+
const length = options?.outputLength;
|
|
1342
|
+
if (length !== void 0 && length !== state.clone().digest().length) throw codeError(/* @__PURE__ */ new Error("error:030000B2:digital envelope routines::not XOF or invalid length"), "ERR_OSSL_EVP_NOT_XOF_OR_INVALID_LENGTH");
|
|
1343
|
+
super(state, () => {
|
|
1344
|
+
throw finalized();
|
|
1345
|
+
}, options);
|
|
1346
|
+
}
|
|
1347
|
+
copy(options) {
|
|
1348
|
+
return new Hash(this.state.clone(), options);
|
|
1349
|
+
}
|
|
1350
|
+
};
|
|
1351
|
+
const createHash = (algorithm, options) => new Hash(algorithm, options);
|
|
1352
|
+
const hash = (algorithm, data, options = "hex") => output(hasherOf(algorithm, "one-shot")(bytesOf(data)), typeof options === "string" ? options : options.outputEncoding ?? "hex");
|
|
1353
|
+
var Hmac = class extends Digest {
|
|
1354
|
+
constructor(algorithm, key, options) {
|
|
1355
|
+
const hasher = hasherOf(algorithm, "digest");
|
|
1356
|
+
const secret = bytesOf(key, typeof key === "string" ? options?.encoding : void 0);
|
|
1357
|
+
super(hmac.create(hasher, secret), () => /* @__PURE__ */ new Uint8Array(0), options);
|
|
1358
|
+
}
|
|
1359
|
+
};
|
|
1360
|
+
const createHmac = (algorithm, key, options) => new Hmac(algorithm, key, options);
|
|
1361
|
+
function timingSafeEqual(a, b) {
|
|
1362
|
+
if (a.byteLength !== b.byteLength) throw codeError(/* @__PURE__ */ new RangeError("Input buffers must have the same byte length"), "ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH");
|
|
1363
|
+
const left = bytesOf(a);
|
|
1364
|
+
const right = bytesOf(b);
|
|
1365
|
+
let difference = 0;
|
|
1366
|
+
for (let i = 0; i < left.length; i++) difference |= left[i] ^ right[i];
|
|
1367
|
+
return difference === 0;
|
|
1368
|
+
}
|
|
1369
|
+
var crypto_default = {
|
|
1370
|
+
...crypto_default$1,
|
|
1371
|
+
webcrypto,
|
|
1372
|
+
subtle,
|
|
1373
|
+
randomUUID,
|
|
1374
|
+
getRandomValues,
|
|
1375
|
+
randomFillSync,
|
|
1376
|
+
randomFill,
|
|
1377
|
+
randomBytes,
|
|
1378
|
+
randomInt,
|
|
1379
|
+
getHashes,
|
|
1380
|
+
Hash,
|
|
1381
|
+
createHash,
|
|
1382
|
+
hash,
|
|
1383
|
+
Hmac,
|
|
1384
|
+
createHmac,
|
|
1385
|
+
timingSafeEqual
|
|
1386
|
+
};
|
|
1387
|
+
//#endregion
|
|
1388
|
+
export { Certificate, Cipher, Cipheriv, Decipher, Decipheriv, DiffieHellman, DiffieHellmanGroup, ECDH, Hash, Hmac, KeyObject, Sign, Verify, X509Certificate, checkPrime, checkPrimeSync, constants, createCipher, createCipheriv, createDecipher, createDecipheriv, createDiffieHellman, createDiffieHellmanGroup, createECDH, createHash, createHmac, createPrivateKey, createPublicKey, createSecretKey, createSign, createVerify, crypto_default as default, diffieHellman, fips, generateKey, generateKeyPair, generateKeyPairSync, generateKeySync, generatePrime, generatePrimeSync, getCipherInfo, getCiphers, getCurves, getDiffieHellman, getFips, getHashes, getRandomValues, hash, hkdf, hkdfSync, pbkdf2, pbkdf2Sync, privateDecrypt, privateEncrypt, prng, pseudoRandomBytes, publicDecrypt, publicEncrypt, randomBytes, randomFill, randomFillSync, randomInt, randomUUID, rng, scrypt, scryptSync, secureHeapUsed, setEngine, setFips, sign, subtle, timingSafeEqual, verify, webcrypto };
|