@aurum-sdk/core 0.2.3 → 0.2.5

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.
@@ -0,0 +1,891 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+ var _chunkQIPVNM7Tjs = require('./chunk-QIPVNM7T.js');
6
+
7
+ // ../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.js
8
+ var require_eventemitter3 = _chunkQIPVNM7Tjs.__commonJS.call(void 0, {
9
+ "../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.js"(exports, module) {
10
+ "use strict";
11
+ _chunkQIPVNM7Tjs.init_polyfills.call(void 0, );
12
+ var has = Object.prototype.hasOwnProperty;
13
+ var prefix = "~";
14
+ function Events() {
15
+ }
16
+ if (Object.create) {
17
+ Events.prototype = /* @__PURE__ */ Object.create(null);
18
+ if (!new Events().__proto__) prefix = false;
19
+ }
20
+ function EE(fn, context, once) {
21
+ this.fn = fn;
22
+ this.context = context;
23
+ this.once = once || false;
24
+ }
25
+ function addListener(emitter, event, fn, context, once) {
26
+ if (typeof fn !== "function") {
27
+ throw new TypeError("The listener must be a function");
28
+ }
29
+ var listener = new EE(fn, context || emitter, once), evt = prefix ? prefix + event : event;
30
+ if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;
31
+ else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);
32
+ else emitter._events[evt] = [emitter._events[evt], listener];
33
+ return emitter;
34
+ }
35
+ function clearEvent(emitter, evt) {
36
+ if (--emitter._eventsCount === 0) emitter._events = new Events();
37
+ else delete emitter._events[evt];
38
+ }
39
+ function EventEmitter2() {
40
+ this._events = new Events();
41
+ this._eventsCount = 0;
42
+ }
43
+ EventEmitter2.prototype.eventNames = function eventNames() {
44
+ var names = [], events, name;
45
+ if (this._eventsCount === 0) return names;
46
+ for (name in events = this._events) {
47
+ if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
48
+ }
49
+ if (Object.getOwnPropertySymbols) {
50
+ return names.concat(Object.getOwnPropertySymbols(events));
51
+ }
52
+ return names;
53
+ };
54
+ EventEmitter2.prototype.listeners = function listeners(event) {
55
+ var evt = prefix ? prefix + event : event, handlers = this._events[evt];
56
+ if (!handlers) return [];
57
+ if (handlers.fn) return [handlers.fn];
58
+ for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {
59
+ ee[i] = handlers[i].fn;
60
+ }
61
+ return ee;
62
+ };
63
+ EventEmitter2.prototype.listenerCount = function listenerCount(event) {
64
+ var evt = prefix ? prefix + event : event, listeners = this._events[evt];
65
+ if (!listeners) return 0;
66
+ if (listeners.fn) return 1;
67
+ return listeners.length;
68
+ };
69
+ EventEmitter2.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
70
+ var evt = prefix ? prefix + event : event;
71
+ if (!this._events[evt]) return false;
72
+ var listeners = this._events[evt], len = arguments.length, args, i;
73
+ if (listeners.fn) {
74
+ if (listeners.once) this.removeListener(event, listeners.fn, void 0, true);
75
+ switch (len) {
76
+ case 1:
77
+ return listeners.fn.call(listeners.context), true;
78
+ case 2:
79
+ return listeners.fn.call(listeners.context, a1), true;
80
+ case 3:
81
+ return listeners.fn.call(listeners.context, a1, a2), true;
82
+ case 4:
83
+ return listeners.fn.call(listeners.context, a1, a2, a3), true;
84
+ case 5:
85
+ return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
86
+ case 6:
87
+ return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
88
+ }
89
+ for (i = 1, args = new Array(len - 1); i < len; i++) {
90
+ args[i - 1] = arguments[i];
91
+ }
92
+ listeners.fn.apply(listeners.context, args);
93
+ } else {
94
+ var length = listeners.length, j;
95
+ for (i = 0; i < length; i++) {
96
+ if (listeners[i].once) this.removeListener(event, listeners[i].fn, void 0, true);
97
+ switch (len) {
98
+ case 1:
99
+ listeners[i].fn.call(listeners[i].context);
100
+ break;
101
+ case 2:
102
+ listeners[i].fn.call(listeners[i].context, a1);
103
+ break;
104
+ case 3:
105
+ listeners[i].fn.call(listeners[i].context, a1, a2);
106
+ break;
107
+ case 4:
108
+ listeners[i].fn.call(listeners[i].context, a1, a2, a3);
109
+ break;
110
+ default:
111
+ if (!args) for (j = 1, args = new Array(len - 1); j < len; j++) {
112
+ args[j - 1] = arguments[j];
113
+ }
114
+ listeners[i].fn.apply(listeners[i].context, args);
115
+ }
116
+ }
117
+ }
118
+ return true;
119
+ };
120
+ EventEmitter2.prototype.on = function on(event, fn, context) {
121
+ return addListener(this, event, fn, context, false);
122
+ };
123
+ EventEmitter2.prototype.once = function once(event, fn, context) {
124
+ return addListener(this, event, fn, context, true);
125
+ };
126
+ EventEmitter2.prototype.removeListener = function removeListener(event, fn, context, once) {
127
+ var evt = prefix ? prefix + event : event;
128
+ if (!this._events[evt]) return this;
129
+ if (!fn) {
130
+ clearEvent(this, evt);
131
+ return this;
132
+ }
133
+ var listeners = this._events[evt];
134
+ if (listeners.fn) {
135
+ if (listeners.fn === fn && (!once || listeners.once) && (!context || listeners.context === context)) {
136
+ clearEvent(this, evt);
137
+ }
138
+ } else {
139
+ for (var i = 0, events = [], length = listeners.length; i < length; i++) {
140
+ if (listeners[i].fn !== fn || once && !listeners[i].once || context && listeners[i].context !== context) {
141
+ events.push(listeners[i]);
142
+ }
143
+ }
144
+ if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
145
+ else clearEvent(this, evt);
146
+ }
147
+ return this;
148
+ };
149
+ EventEmitter2.prototype.removeAllListeners = function removeAllListeners(event) {
150
+ var evt;
151
+ if (event) {
152
+ evt = prefix ? prefix + event : event;
153
+ if (this._events[evt]) clearEvent(this, evt);
154
+ } else {
155
+ this._events = new Events();
156
+ this._eventsCount = 0;
157
+ }
158
+ return this;
159
+ };
160
+ EventEmitter2.prototype.off = EventEmitter2.prototype.removeListener;
161
+ EventEmitter2.prototype.addListener = EventEmitter2.prototype.on;
162
+ EventEmitter2.prefixed = prefix;
163
+ EventEmitter2.EventEmitter = EventEmitter2;
164
+ if ("undefined" !== typeof module) {
165
+ module.exports = EventEmitter2;
166
+ }
167
+ }
168
+ });
169
+
170
+ // ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/sha256.js
171
+ _chunkQIPVNM7Tjs.init_polyfills.call(void 0, );
172
+
173
+ // ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/sha2.js
174
+ _chunkQIPVNM7Tjs.init_polyfills.call(void 0, );
175
+
176
+ // ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/_md.js
177
+ _chunkQIPVNM7Tjs.init_polyfills.call(void 0, );
178
+
179
+ // ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/utils.js
180
+ _chunkQIPVNM7Tjs.init_polyfills.call(void 0, );
181
+
182
+ // ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/crypto.js
183
+ _chunkQIPVNM7Tjs.init_polyfills.call(void 0, );
184
+ var crypto = typeof globalThis === "object" && "crypto" in globalThis ? globalThis.crypto : void 0;
185
+
186
+ // ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/utils.js
187
+ function isBytes(a) {
188
+ return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
189
+ }
190
+ function anumber(n) {
191
+ if (!Number.isSafeInteger(n) || n < 0)
192
+ throw new Error("positive integer expected, got " + n);
193
+ }
194
+ function abytes(b, ...lengths) {
195
+ if (!isBytes(b))
196
+ throw new Error("Uint8Array expected");
197
+ if (lengths.length > 0 && !lengths.includes(b.length))
198
+ throw new Error("Uint8Array expected of length " + lengths + ", got length=" + b.length);
199
+ }
200
+ function ahash(h) {
201
+ if (typeof h !== "function" || typeof h.create !== "function")
202
+ throw new Error("Hash should be wrapped by utils.createHasher");
203
+ anumber(h.outputLen);
204
+ anumber(h.blockLen);
205
+ }
206
+ function aexists(instance, checkFinished = true) {
207
+ if (instance.destroyed)
208
+ throw new Error("Hash instance has been destroyed");
209
+ if (checkFinished && instance.finished)
210
+ throw new Error("Hash#digest() has already been called");
211
+ }
212
+ function aoutput(out, instance) {
213
+ abytes(out);
214
+ const min = instance.outputLen;
215
+ if (out.length < min) {
216
+ throw new Error("digestInto() expects output buffer of length at least " + min);
217
+ }
218
+ }
219
+ function u32(arr) {
220
+ return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
221
+ }
222
+ function clean(...arrays) {
223
+ for (let i = 0; i < arrays.length; i++) {
224
+ arrays[i].fill(0);
225
+ }
226
+ }
227
+ function createView(arr) {
228
+ return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
229
+ }
230
+ function rotr(word, shift) {
231
+ return word << 32 - shift | word >>> shift;
232
+ }
233
+ var isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68)();
234
+ function byteSwap(word) {
235
+ return word << 24 & 4278190080 | word << 8 & 16711680 | word >>> 8 & 65280 | word >>> 24 & 255;
236
+ }
237
+ function byteSwap32(arr) {
238
+ for (let i = 0; i < arr.length; i++) {
239
+ arr[i] = byteSwap(arr[i]);
240
+ }
241
+ return arr;
242
+ }
243
+ var swap32IfBE = isLE ? (u) => u : byteSwap32;
244
+ var hasHexBuiltin = /* @__PURE__ */ (() => (
245
+ // @ts-ignore
246
+ typeof Uint8Array.from([]).toHex === "function" && typeof Uint8Array.fromHex === "function"
247
+ ))();
248
+ var hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
249
+ function bytesToHex(bytes) {
250
+ abytes(bytes);
251
+ if (hasHexBuiltin)
252
+ return bytes.toHex();
253
+ let hex = "";
254
+ for (let i = 0; i < bytes.length; i++) {
255
+ hex += hexes[bytes[i]];
256
+ }
257
+ return hex;
258
+ }
259
+ var asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };
260
+ function asciiToBase16(ch) {
261
+ if (ch >= asciis._0 && ch <= asciis._9)
262
+ return ch - asciis._0;
263
+ if (ch >= asciis.A && ch <= asciis.F)
264
+ return ch - (asciis.A - 10);
265
+ if (ch >= asciis.a && ch <= asciis.f)
266
+ return ch - (asciis.a - 10);
267
+ return;
268
+ }
269
+ function hexToBytes(hex) {
270
+ if (typeof hex !== "string")
271
+ throw new Error("hex string expected, got " + typeof hex);
272
+ if (hasHexBuiltin)
273
+ return Uint8Array.fromHex(hex);
274
+ const hl = hex.length;
275
+ const al = hl / 2;
276
+ if (hl % 2)
277
+ throw new Error("hex string expected, got unpadded hex of length " + hl);
278
+ const array = new Uint8Array(al);
279
+ for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {
280
+ const n1 = asciiToBase16(hex.charCodeAt(hi));
281
+ const n2 = asciiToBase16(hex.charCodeAt(hi + 1));
282
+ if (n1 === void 0 || n2 === void 0) {
283
+ const char = hex[hi] + hex[hi + 1];
284
+ throw new Error('hex string expected, got non-hex character "' + char + '" at index ' + hi);
285
+ }
286
+ array[ai] = n1 * 16 + n2;
287
+ }
288
+ return array;
289
+ }
290
+ function utf8ToBytes(str) {
291
+ if (typeof str !== "string")
292
+ throw new Error("string expected");
293
+ return new Uint8Array(new TextEncoder().encode(str));
294
+ }
295
+ function toBytes(data) {
296
+ if (typeof data === "string")
297
+ data = utf8ToBytes(data);
298
+ abytes(data);
299
+ return data;
300
+ }
301
+ function concatBytes(...arrays) {
302
+ let sum = 0;
303
+ for (let i = 0; i < arrays.length; i++) {
304
+ const a = arrays[i];
305
+ abytes(a);
306
+ sum += a.length;
307
+ }
308
+ const res = new Uint8Array(sum);
309
+ for (let i = 0, pad = 0; i < arrays.length; i++) {
310
+ const a = arrays[i];
311
+ res.set(a, pad);
312
+ pad += a.length;
313
+ }
314
+ return res;
315
+ }
316
+ var Hash = class {
317
+ };
318
+ function createHasher(hashCons) {
319
+ const hashC = (msg) => hashCons().update(toBytes(msg)).digest();
320
+ const tmp = hashCons();
321
+ hashC.outputLen = tmp.outputLen;
322
+ hashC.blockLen = tmp.blockLen;
323
+ hashC.create = () => hashCons();
324
+ return hashC;
325
+ }
326
+ function randomBytes(bytesLength = 32) {
327
+ if (crypto && typeof crypto.getRandomValues === "function") {
328
+ return crypto.getRandomValues(new Uint8Array(bytesLength));
329
+ }
330
+ if (crypto && typeof crypto.randomBytes === "function") {
331
+ return Uint8Array.from(crypto.randomBytes(bytesLength));
332
+ }
333
+ throw new Error("crypto.getRandomValues must be defined");
334
+ }
335
+
336
+ // ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/_md.js
337
+ function setBigUint64(view, byteOffset, value, isLE2) {
338
+ if (typeof view.setBigUint64 === "function")
339
+ return view.setBigUint64(byteOffset, value, isLE2);
340
+ const _32n2 = BigInt(32);
341
+ const _u32_max = BigInt(4294967295);
342
+ const wh = Number(value >> _32n2 & _u32_max);
343
+ const wl = Number(value & _u32_max);
344
+ const h = isLE2 ? 4 : 0;
345
+ const l = isLE2 ? 0 : 4;
346
+ view.setUint32(byteOffset + h, wh, isLE2);
347
+ view.setUint32(byteOffset + l, wl, isLE2);
348
+ }
349
+ function Chi(a, b, c) {
350
+ return a & b ^ ~a & c;
351
+ }
352
+ function Maj(a, b, c) {
353
+ return a & b ^ a & c ^ b & c;
354
+ }
355
+ var HashMD = class extends Hash {
356
+ constructor(blockLen, outputLen, padOffset, isLE2) {
357
+ super();
358
+ this.finished = false;
359
+ this.length = 0;
360
+ this.pos = 0;
361
+ this.destroyed = false;
362
+ this.blockLen = blockLen;
363
+ this.outputLen = outputLen;
364
+ this.padOffset = padOffset;
365
+ this.isLE = isLE2;
366
+ this.buffer = new Uint8Array(blockLen);
367
+ this.view = createView(this.buffer);
368
+ }
369
+ update(data) {
370
+ aexists(this);
371
+ data = toBytes(data);
372
+ abytes(data);
373
+ const { view, buffer, blockLen } = this;
374
+ const len = data.length;
375
+ for (let pos = 0; pos < len; ) {
376
+ const take = Math.min(blockLen - this.pos, len - pos);
377
+ if (take === blockLen) {
378
+ const dataView = createView(data);
379
+ for (; blockLen <= len - pos; pos += blockLen)
380
+ this.process(dataView, pos);
381
+ continue;
382
+ }
383
+ buffer.set(data.subarray(pos, pos + take), this.pos);
384
+ this.pos += take;
385
+ pos += take;
386
+ if (this.pos === blockLen) {
387
+ this.process(view, 0);
388
+ this.pos = 0;
389
+ }
390
+ }
391
+ this.length += data.length;
392
+ this.roundClean();
393
+ return this;
394
+ }
395
+ digestInto(out) {
396
+ aexists(this);
397
+ aoutput(out, this);
398
+ this.finished = true;
399
+ const { buffer, view, blockLen, isLE: isLE2 } = this;
400
+ let { pos } = this;
401
+ buffer[pos++] = 128;
402
+ clean(this.buffer.subarray(pos));
403
+ if (this.padOffset > blockLen - pos) {
404
+ this.process(view, 0);
405
+ pos = 0;
406
+ }
407
+ for (let i = pos; i < blockLen; i++)
408
+ buffer[i] = 0;
409
+ setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE2);
410
+ this.process(view, 0);
411
+ const oview = createView(out);
412
+ const len = this.outputLen;
413
+ if (len % 4)
414
+ throw new Error("_sha2: outputLen should be aligned to 32bit");
415
+ const outLen = len / 4;
416
+ const state = this.get();
417
+ if (outLen > state.length)
418
+ throw new Error("_sha2: outputLen bigger than state");
419
+ for (let i = 0; i < outLen; i++)
420
+ oview.setUint32(4 * i, state[i], isLE2);
421
+ }
422
+ digest() {
423
+ const { buffer, outputLen } = this;
424
+ this.digestInto(buffer);
425
+ const res = buffer.slice(0, outputLen);
426
+ this.destroy();
427
+ return res;
428
+ }
429
+ _cloneInto(to) {
430
+ to || (to = new this.constructor());
431
+ to.set(...this.get());
432
+ const { blockLen, buffer, length, finished, destroyed, pos } = this;
433
+ to.destroyed = destroyed;
434
+ to.finished = finished;
435
+ to.length = length;
436
+ to.pos = pos;
437
+ if (length % blockLen)
438
+ to.buffer.set(buffer);
439
+ return to;
440
+ }
441
+ clone() {
442
+ return this._cloneInto();
443
+ }
444
+ };
445
+ var SHA256_IV = /* @__PURE__ */ Uint32Array.from([
446
+ 1779033703,
447
+ 3144134277,
448
+ 1013904242,
449
+ 2773480762,
450
+ 1359893119,
451
+ 2600822924,
452
+ 528734635,
453
+ 1541459225
454
+ ]);
455
+ var SHA512_IV = /* @__PURE__ */ Uint32Array.from([
456
+ 1779033703,
457
+ 4089235720,
458
+ 3144134277,
459
+ 2227873595,
460
+ 1013904242,
461
+ 4271175723,
462
+ 2773480762,
463
+ 1595750129,
464
+ 1359893119,
465
+ 2917565137,
466
+ 2600822924,
467
+ 725511199,
468
+ 528734635,
469
+ 4215389547,
470
+ 1541459225,
471
+ 327033209
472
+ ]);
473
+
474
+ // ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/_u64.js
475
+ _chunkQIPVNM7Tjs.init_polyfills.call(void 0, );
476
+ var U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);
477
+ var _32n = /* @__PURE__ */ BigInt(32);
478
+ function fromBig(n, le = false) {
479
+ if (le)
480
+ return { h: Number(n & U32_MASK64), l: Number(n >> _32n & U32_MASK64) };
481
+ return { h: Number(n >> _32n & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };
482
+ }
483
+ function split(lst, le = false) {
484
+ const len = lst.length;
485
+ let Ah = new Uint32Array(len);
486
+ let Al = new Uint32Array(len);
487
+ for (let i = 0; i < len; i++) {
488
+ const { h, l } = fromBig(lst[i], le);
489
+ [Ah[i], Al[i]] = [h, l];
490
+ }
491
+ return [Ah, Al];
492
+ }
493
+ var shrSH = (h, _l, s) => h >>> s;
494
+ var shrSL = (h, l, s) => h << 32 - s | l >>> s;
495
+ var rotrSH = (h, l, s) => h >>> s | l << 32 - s;
496
+ var rotrSL = (h, l, s) => h << 32 - s | l >>> s;
497
+ var rotrBH = (h, l, s) => h << 64 - s | l >>> s - 32;
498
+ var rotrBL = (h, l, s) => h >>> s - 32 | l << 64 - s;
499
+ var rotlSH = (h, l, s) => h << s | l >>> 32 - s;
500
+ var rotlSL = (h, l, s) => l << s | h >>> 32 - s;
501
+ var rotlBH = (h, l, s) => l << s - 32 | h >>> 64 - s;
502
+ var rotlBL = (h, l, s) => h << s - 32 | l >>> 64 - s;
503
+ function add(Ah, Al, Bh, Bl) {
504
+ const l = (Al >>> 0) + (Bl >>> 0);
505
+ return { h: Ah + Bh + (l / 2 ** 32 | 0) | 0, l: l | 0 };
506
+ }
507
+ var add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);
508
+ var add3H = (low, Ah, Bh, Ch) => Ah + Bh + Ch + (low / 2 ** 32 | 0) | 0;
509
+ var add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);
510
+ var add4H = (low, Ah, Bh, Ch, Dh) => Ah + Bh + Ch + Dh + (low / 2 ** 32 | 0) | 0;
511
+ var add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);
512
+ var add5H = (low, Ah, Bh, Ch, Dh, Eh) => Ah + Bh + Ch + Dh + Eh + (low / 2 ** 32 | 0) | 0;
513
+
514
+ // ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/sha2.js
515
+ var SHA256_K = /* @__PURE__ */ Uint32Array.from([
516
+ 1116352408,
517
+ 1899447441,
518
+ 3049323471,
519
+ 3921009573,
520
+ 961987163,
521
+ 1508970993,
522
+ 2453635748,
523
+ 2870763221,
524
+ 3624381080,
525
+ 310598401,
526
+ 607225278,
527
+ 1426881987,
528
+ 1925078388,
529
+ 2162078206,
530
+ 2614888103,
531
+ 3248222580,
532
+ 3835390401,
533
+ 4022224774,
534
+ 264347078,
535
+ 604807628,
536
+ 770255983,
537
+ 1249150122,
538
+ 1555081692,
539
+ 1996064986,
540
+ 2554220882,
541
+ 2821834349,
542
+ 2952996808,
543
+ 3210313671,
544
+ 3336571891,
545
+ 3584528711,
546
+ 113926993,
547
+ 338241895,
548
+ 666307205,
549
+ 773529912,
550
+ 1294757372,
551
+ 1396182291,
552
+ 1695183700,
553
+ 1986661051,
554
+ 2177026350,
555
+ 2456956037,
556
+ 2730485921,
557
+ 2820302411,
558
+ 3259730800,
559
+ 3345764771,
560
+ 3516065817,
561
+ 3600352804,
562
+ 4094571909,
563
+ 275423344,
564
+ 430227734,
565
+ 506948616,
566
+ 659060556,
567
+ 883997877,
568
+ 958139571,
569
+ 1322822218,
570
+ 1537002063,
571
+ 1747873779,
572
+ 1955562222,
573
+ 2024104815,
574
+ 2227730452,
575
+ 2361852424,
576
+ 2428436474,
577
+ 2756734187,
578
+ 3204031479,
579
+ 3329325298
580
+ ]);
581
+ var SHA256_W = /* @__PURE__ */ new Uint32Array(64);
582
+ var SHA256 = class extends HashMD {
583
+ constructor(outputLen = 32) {
584
+ super(64, outputLen, 8, false);
585
+ this.A = SHA256_IV[0] | 0;
586
+ this.B = SHA256_IV[1] | 0;
587
+ this.C = SHA256_IV[2] | 0;
588
+ this.D = SHA256_IV[3] | 0;
589
+ this.E = SHA256_IV[4] | 0;
590
+ this.F = SHA256_IV[5] | 0;
591
+ this.G = SHA256_IV[6] | 0;
592
+ this.H = SHA256_IV[7] | 0;
593
+ }
594
+ get() {
595
+ const { A, B, C, D, E, F, G, H } = this;
596
+ return [A, B, C, D, E, F, G, H];
597
+ }
598
+ // prettier-ignore
599
+ set(A, B, C, D, E, F, G, H) {
600
+ this.A = A | 0;
601
+ this.B = B | 0;
602
+ this.C = C | 0;
603
+ this.D = D | 0;
604
+ this.E = E | 0;
605
+ this.F = F | 0;
606
+ this.G = G | 0;
607
+ this.H = H | 0;
608
+ }
609
+ process(view, offset) {
610
+ for (let i = 0; i < 16; i++, offset += 4)
611
+ SHA256_W[i] = view.getUint32(offset, false);
612
+ for (let i = 16; i < 64; i++) {
613
+ const W15 = SHA256_W[i - 15];
614
+ const W2 = SHA256_W[i - 2];
615
+ const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ W15 >>> 3;
616
+ const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ W2 >>> 10;
617
+ SHA256_W[i] = s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16] | 0;
618
+ }
619
+ let { A, B, C, D, E, F, G, H } = this;
620
+ for (let i = 0; i < 64; i++) {
621
+ const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);
622
+ const T1 = H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i] | 0;
623
+ const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22);
624
+ const T2 = sigma0 + Maj(A, B, C) | 0;
625
+ H = G;
626
+ G = F;
627
+ F = E;
628
+ E = D + T1 | 0;
629
+ D = C;
630
+ C = B;
631
+ B = A;
632
+ A = T1 + T2 | 0;
633
+ }
634
+ A = A + this.A | 0;
635
+ B = B + this.B | 0;
636
+ C = C + this.C | 0;
637
+ D = D + this.D | 0;
638
+ E = E + this.E | 0;
639
+ F = F + this.F | 0;
640
+ G = G + this.G | 0;
641
+ H = H + this.H | 0;
642
+ this.set(A, B, C, D, E, F, G, H);
643
+ }
644
+ roundClean() {
645
+ clean(SHA256_W);
646
+ }
647
+ destroy() {
648
+ this.set(0, 0, 0, 0, 0, 0, 0, 0);
649
+ clean(this.buffer);
650
+ }
651
+ };
652
+ var K512 = /* @__PURE__ */ (() => split([
653
+ "0x428a2f98d728ae22",
654
+ "0x7137449123ef65cd",
655
+ "0xb5c0fbcfec4d3b2f",
656
+ "0xe9b5dba58189dbbc",
657
+ "0x3956c25bf348b538",
658
+ "0x59f111f1b605d019",
659
+ "0x923f82a4af194f9b",
660
+ "0xab1c5ed5da6d8118",
661
+ "0xd807aa98a3030242",
662
+ "0x12835b0145706fbe",
663
+ "0x243185be4ee4b28c",
664
+ "0x550c7dc3d5ffb4e2",
665
+ "0x72be5d74f27b896f",
666
+ "0x80deb1fe3b1696b1",
667
+ "0x9bdc06a725c71235",
668
+ "0xc19bf174cf692694",
669
+ "0xe49b69c19ef14ad2",
670
+ "0xefbe4786384f25e3",
671
+ "0x0fc19dc68b8cd5b5",
672
+ "0x240ca1cc77ac9c65",
673
+ "0x2de92c6f592b0275",
674
+ "0x4a7484aa6ea6e483",
675
+ "0x5cb0a9dcbd41fbd4",
676
+ "0x76f988da831153b5",
677
+ "0x983e5152ee66dfab",
678
+ "0xa831c66d2db43210",
679
+ "0xb00327c898fb213f",
680
+ "0xbf597fc7beef0ee4",
681
+ "0xc6e00bf33da88fc2",
682
+ "0xd5a79147930aa725",
683
+ "0x06ca6351e003826f",
684
+ "0x142929670a0e6e70",
685
+ "0x27b70a8546d22ffc",
686
+ "0x2e1b21385c26c926",
687
+ "0x4d2c6dfc5ac42aed",
688
+ "0x53380d139d95b3df",
689
+ "0x650a73548baf63de",
690
+ "0x766a0abb3c77b2a8",
691
+ "0x81c2c92e47edaee6",
692
+ "0x92722c851482353b",
693
+ "0xa2bfe8a14cf10364",
694
+ "0xa81a664bbc423001",
695
+ "0xc24b8b70d0f89791",
696
+ "0xc76c51a30654be30",
697
+ "0xd192e819d6ef5218",
698
+ "0xd69906245565a910",
699
+ "0xf40e35855771202a",
700
+ "0x106aa07032bbd1b8",
701
+ "0x19a4c116b8d2d0c8",
702
+ "0x1e376c085141ab53",
703
+ "0x2748774cdf8eeb99",
704
+ "0x34b0bcb5e19b48a8",
705
+ "0x391c0cb3c5c95a63",
706
+ "0x4ed8aa4ae3418acb",
707
+ "0x5b9cca4f7763e373",
708
+ "0x682e6ff3d6b2b8a3",
709
+ "0x748f82ee5defb2fc",
710
+ "0x78a5636f43172f60",
711
+ "0x84c87814a1f0ab72",
712
+ "0x8cc702081a6439ec",
713
+ "0x90befffa23631e28",
714
+ "0xa4506cebde82bde9",
715
+ "0xbef9a3f7b2c67915",
716
+ "0xc67178f2e372532b",
717
+ "0xca273eceea26619c",
718
+ "0xd186b8c721c0c207",
719
+ "0xeada7dd6cde0eb1e",
720
+ "0xf57d4f7fee6ed178",
721
+ "0x06f067aa72176fba",
722
+ "0x0a637dc5a2c898a6",
723
+ "0x113f9804bef90dae",
724
+ "0x1b710b35131c471b",
725
+ "0x28db77f523047d84",
726
+ "0x32caab7b40c72493",
727
+ "0x3c9ebe0a15c9bebc",
728
+ "0x431d67c49c100d4c",
729
+ "0x4cc5d4becb3e42b6",
730
+ "0x597f299cfc657e2a",
731
+ "0x5fcb6fab3ad6faec",
732
+ "0x6c44198c4a475817"
733
+ ].map((n) => BigInt(n))))();
734
+ var SHA512_Kh = /* @__PURE__ */ (() => K512[0])();
735
+ var SHA512_Kl = /* @__PURE__ */ (() => K512[1])();
736
+ var SHA512_W_H = /* @__PURE__ */ new Uint32Array(80);
737
+ var SHA512_W_L = /* @__PURE__ */ new Uint32Array(80);
738
+ var SHA512 = class extends HashMD {
739
+ constructor(outputLen = 64) {
740
+ super(128, outputLen, 16, false);
741
+ this.Ah = SHA512_IV[0] | 0;
742
+ this.Al = SHA512_IV[1] | 0;
743
+ this.Bh = SHA512_IV[2] | 0;
744
+ this.Bl = SHA512_IV[3] | 0;
745
+ this.Ch = SHA512_IV[4] | 0;
746
+ this.Cl = SHA512_IV[5] | 0;
747
+ this.Dh = SHA512_IV[6] | 0;
748
+ this.Dl = SHA512_IV[7] | 0;
749
+ this.Eh = SHA512_IV[8] | 0;
750
+ this.El = SHA512_IV[9] | 0;
751
+ this.Fh = SHA512_IV[10] | 0;
752
+ this.Fl = SHA512_IV[11] | 0;
753
+ this.Gh = SHA512_IV[12] | 0;
754
+ this.Gl = SHA512_IV[13] | 0;
755
+ this.Hh = SHA512_IV[14] | 0;
756
+ this.Hl = SHA512_IV[15] | 0;
757
+ }
758
+ // prettier-ignore
759
+ get() {
760
+ const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;
761
+ return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl];
762
+ }
763
+ // prettier-ignore
764
+ set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) {
765
+ this.Ah = Ah | 0;
766
+ this.Al = Al | 0;
767
+ this.Bh = Bh | 0;
768
+ this.Bl = Bl | 0;
769
+ this.Ch = Ch | 0;
770
+ this.Cl = Cl | 0;
771
+ this.Dh = Dh | 0;
772
+ this.Dl = Dl | 0;
773
+ this.Eh = Eh | 0;
774
+ this.El = El | 0;
775
+ this.Fh = Fh | 0;
776
+ this.Fl = Fl | 0;
777
+ this.Gh = Gh | 0;
778
+ this.Gl = Gl | 0;
779
+ this.Hh = Hh | 0;
780
+ this.Hl = Hl | 0;
781
+ }
782
+ process(view, offset) {
783
+ for (let i = 0; i < 16; i++, offset += 4) {
784
+ SHA512_W_H[i] = view.getUint32(offset);
785
+ SHA512_W_L[i] = view.getUint32(offset += 4);
786
+ }
787
+ for (let i = 16; i < 80; i++) {
788
+ const W15h = SHA512_W_H[i - 15] | 0;
789
+ const W15l = SHA512_W_L[i - 15] | 0;
790
+ const s0h = rotrSH(W15h, W15l, 1) ^ rotrSH(W15h, W15l, 8) ^ shrSH(W15h, W15l, 7);
791
+ const s0l = rotrSL(W15h, W15l, 1) ^ rotrSL(W15h, W15l, 8) ^ shrSL(W15h, W15l, 7);
792
+ const W2h = SHA512_W_H[i - 2] | 0;
793
+ const W2l = SHA512_W_L[i - 2] | 0;
794
+ const s1h = rotrSH(W2h, W2l, 19) ^ rotrBH(W2h, W2l, 61) ^ shrSH(W2h, W2l, 6);
795
+ const s1l = rotrSL(W2h, W2l, 19) ^ rotrBL(W2h, W2l, 61) ^ shrSL(W2h, W2l, 6);
796
+ const SUMl = add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);
797
+ const SUMh = add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);
798
+ SHA512_W_H[i] = SUMh | 0;
799
+ SHA512_W_L[i] = SUMl | 0;
800
+ }
801
+ let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;
802
+ for (let i = 0; i < 80; i++) {
803
+ const sigma1h = rotrSH(Eh, El, 14) ^ rotrSH(Eh, El, 18) ^ rotrBH(Eh, El, 41);
804
+ const sigma1l = rotrSL(Eh, El, 14) ^ rotrSL(Eh, El, 18) ^ rotrBL(Eh, El, 41);
805
+ const CHIh = Eh & Fh ^ ~Eh & Gh;
806
+ const CHIl = El & Fl ^ ~El & Gl;
807
+ const T1ll = add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);
808
+ const T1h = add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);
809
+ const T1l = T1ll | 0;
810
+ const sigma0h = rotrSH(Ah, Al, 28) ^ rotrBH(Ah, Al, 34) ^ rotrBH(Ah, Al, 39);
811
+ const sigma0l = rotrSL(Ah, Al, 28) ^ rotrBL(Ah, Al, 34) ^ rotrBL(Ah, Al, 39);
812
+ const MAJh = Ah & Bh ^ Ah & Ch ^ Bh & Ch;
813
+ const MAJl = Al & Bl ^ Al & Cl ^ Bl & Cl;
814
+ Hh = Gh | 0;
815
+ Hl = Gl | 0;
816
+ Gh = Fh | 0;
817
+ Gl = Fl | 0;
818
+ Fh = Eh | 0;
819
+ Fl = El | 0;
820
+ ({ h: Eh, l: El } = add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));
821
+ Dh = Ch | 0;
822
+ Dl = Cl | 0;
823
+ Ch = Bh | 0;
824
+ Cl = Bl | 0;
825
+ Bh = Ah | 0;
826
+ Bl = Al | 0;
827
+ const All = add3L(T1l, sigma0l, MAJl);
828
+ Ah = add3H(All, T1h, sigma0h, MAJh);
829
+ Al = All | 0;
830
+ }
831
+ ({ h: Ah, l: Al } = add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));
832
+ ({ h: Bh, l: Bl } = add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));
833
+ ({ h: Ch, l: Cl } = add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));
834
+ ({ h: Dh, l: Dl } = add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));
835
+ ({ h: Eh, l: El } = add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));
836
+ ({ h: Fh, l: Fl } = add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));
837
+ ({ h: Gh, l: Gl } = add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));
838
+ ({ h: Hh, l: Hl } = add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));
839
+ this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl);
840
+ }
841
+ roundClean() {
842
+ clean(SHA512_W_H, SHA512_W_L);
843
+ }
844
+ destroy() {
845
+ clean(this.buffer);
846
+ this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
847
+ }
848
+ };
849
+ var sha256 = /* @__PURE__ */ createHasher(() => new SHA256());
850
+ var sha512 = /* @__PURE__ */ createHasher(() => new SHA512());
851
+
852
+ // ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/sha256.js
853
+ var sha2562 = sha256;
854
+
855
+ // ../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.mjs
856
+ _chunkQIPVNM7Tjs.init_polyfills.call(void 0, );
857
+ var import_index = _chunkQIPVNM7Tjs.__toESM.call(void 0, require_eventemitter3(), 1);
858
+
859
+
860
+
861
+
862
+
863
+
864
+
865
+
866
+
867
+
868
+
869
+
870
+
871
+
872
+
873
+
874
+
875
+
876
+
877
+
878
+
879
+
880
+
881
+
882
+
883
+
884
+
885
+ exports.isBytes = isBytes; exports.anumber = anumber; exports.abytes = abytes; exports.ahash = ahash; exports.aexists = aexists; exports.aoutput = aoutput; exports.u32 = u32; exports.clean = clean; exports.swap32IfBE = swap32IfBE; exports.bytesToHex = bytesToHex; exports.hexToBytes = hexToBytes; exports.toBytes = toBytes; exports.concatBytes = concatBytes; exports.Hash = Hash; exports.createHasher = createHasher; exports.randomBytes = randomBytes; exports.split = split; exports.rotlSH = rotlSH; exports.rotlSL = rotlSL; exports.rotlBH = rotlBH; exports.rotlBL = rotlBL; exports.sha256 = sha256; exports.sha512 = sha512; exports.sha2562 = sha2562; exports.import_index = import_index;
886
+ /*! Bundled license information:
887
+
888
+ @noble/hashes/esm/utils.js:
889
+ (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
890
+ */
891
+ //# sourceMappingURL=chunk-XTOUIIXZ.js.map