@springmicro/auth 0.7.20 → 0.7.22

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.
@@ -1,4 +1,4 @@
1
- import { C as g } from "./Web3Auth-DG8Yz_cD.js";
1
+ import { C as g } from "./Web3Auth-CYZ2tXRd.js";
2
2
  function u(i, n) {
3
3
  let [e, t = "0"] = i.split(".");
4
4
  const s = e.startsWith("-");
@@ -0,0 +1,178 @@
1
+ import { H as B, j as H, e as y, t as m, f as U, k as _, a as w, c as C, l as x } from "./utils-DbgAoL44.js";
2
+ function I(r, t, n, s) {
3
+ if (typeof r.setBigUint64 == "function")
4
+ return r.setBigUint64(t, n, s);
5
+ const i = BigInt(32), o = BigInt(4294967295), e = Number(n >> i & o), h = Number(n & o), f = s ? 4 : 0, a = s ? 0 : 4;
6
+ r.setUint32(t + f, e, s), r.setUint32(t + a, h, s);
7
+ }
8
+ function L(r, t, n) {
9
+ return r & t ^ ~r & n;
10
+ }
11
+ function D(r, t, n) {
12
+ return r & t ^ r & n ^ t & n;
13
+ }
14
+ class k extends B {
15
+ constructor(t, n, s, i) {
16
+ super(), this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.blockLen = t, this.outputLen = n, this.padOffset = s, this.isLE = i, this.buffer = new Uint8Array(t), this.view = H(this.buffer);
17
+ }
18
+ update(t) {
19
+ y(this), t = m(t), U(t);
20
+ const { view: n, buffer: s, blockLen: i } = this, o = t.length;
21
+ for (let e = 0; e < o; ) {
22
+ const h = Math.min(i - this.pos, o - e);
23
+ if (h === i) {
24
+ const f = H(t);
25
+ for (; i <= o - e; e += i)
26
+ this.process(f, e);
27
+ continue;
28
+ }
29
+ s.set(t.subarray(e, e + h), this.pos), this.pos += h, e += h, this.pos === i && (this.process(n, 0), this.pos = 0);
30
+ }
31
+ return this.length += t.length, this.roundClean(), this;
32
+ }
33
+ digestInto(t) {
34
+ y(this), _(t, this), this.finished = !0;
35
+ const { buffer: n, view: s, blockLen: i, isLE: o } = this;
36
+ let { pos: e } = this;
37
+ n[e++] = 128, w(this.buffer.subarray(e)), this.padOffset > i - e && (this.process(s, 0), e = 0);
38
+ for (let c = e; c < i; c++)
39
+ n[c] = 0;
40
+ I(s, i - 8, BigInt(this.length * 8), o), this.process(s, 0);
41
+ const h = H(t), f = this.outputLen;
42
+ if (f % 4)
43
+ throw new Error("_sha2: outputLen should be aligned to 32bit");
44
+ const a = f / 4, b = this.get();
45
+ if (a > b.length)
46
+ throw new Error("_sha2: outputLen bigger than state");
47
+ for (let c = 0; c < a; c++)
48
+ h.setUint32(4 * c, b[c], o);
49
+ }
50
+ digest() {
51
+ const { buffer: t, outputLen: n } = this;
52
+ this.digestInto(t);
53
+ const s = t.slice(0, n);
54
+ return this.destroy(), s;
55
+ }
56
+ _cloneInto(t) {
57
+ t || (t = new this.constructor()), t.set(...this.get());
58
+ const { blockLen: n, buffer: s, length: i, finished: o, destroyed: e, pos: h } = this;
59
+ return t.destroyed = e, t.finished = o, t.length = i, t.pos = h, i % n && t.buffer.set(s), t;
60
+ }
61
+ clone() {
62
+ return this._cloneInto();
63
+ }
64
+ }
65
+ const u = /* @__PURE__ */ Uint32Array.from([
66
+ 1779033703,
67
+ 3144134277,
68
+ 1013904242,
69
+ 2773480762,
70
+ 1359893119,
71
+ 2600822924,
72
+ 528734635,
73
+ 1541459225
74
+ ]), E = /* @__PURE__ */ Uint32Array.from([
75
+ 1116352408,
76
+ 1899447441,
77
+ 3049323471,
78
+ 3921009573,
79
+ 961987163,
80
+ 1508970993,
81
+ 2453635748,
82
+ 2870763221,
83
+ 3624381080,
84
+ 310598401,
85
+ 607225278,
86
+ 1426881987,
87
+ 1925078388,
88
+ 2162078206,
89
+ 2614888103,
90
+ 3248222580,
91
+ 3835390401,
92
+ 4022224774,
93
+ 264347078,
94
+ 604807628,
95
+ 770255983,
96
+ 1249150122,
97
+ 1555081692,
98
+ 1996064986,
99
+ 2554220882,
100
+ 2821834349,
101
+ 2952996808,
102
+ 3210313671,
103
+ 3336571891,
104
+ 3584528711,
105
+ 113926993,
106
+ 338241895,
107
+ 666307205,
108
+ 773529912,
109
+ 1294757372,
110
+ 1396182291,
111
+ 1695183700,
112
+ 1986661051,
113
+ 2177026350,
114
+ 2456956037,
115
+ 2730485921,
116
+ 2820302411,
117
+ 3259730800,
118
+ 3345764771,
119
+ 3516065817,
120
+ 3600352804,
121
+ 4094571909,
122
+ 275423344,
123
+ 430227734,
124
+ 506948616,
125
+ 659060556,
126
+ 883997877,
127
+ 958139571,
128
+ 1322822218,
129
+ 1537002063,
130
+ 1747873779,
131
+ 1955562222,
132
+ 2024104815,
133
+ 2227730452,
134
+ 2361852424,
135
+ 2428436474,
136
+ 2756734187,
137
+ 3204031479,
138
+ 3329325298
139
+ ]), d = /* @__PURE__ */ new Uint32Array(64);
140
+ class F extends k {
141
+ constructor(t = 32) {
142
+ super(64, t, 8, !1), this.A = u[0] | 0, this.B = u[1] | 0, this.C = u[2] | 0, this.D = u[3] | 0, this.E = u[4] | 0, this.F = u[5] | 0, this.G = u[6] | 0, this.H = u[7] | 0;
143
+ }
144
+ get() {
145
+ const { A: t, B: n, C: s, D: i, E: o, F: e, G: h, H: f } = this;
146
+ return [t, n, s, i, o, e, h, f];
147
+ }
148
+ // prettier-ignore
149
+ set(t, n, s, i, o, e, h, f) {
150
+ this.A = t | 0, this.B = n | 0, this.C = s | 0, this.D = i | 0, this.E = o | 0, this.F = e | 0, this.G = h | 0, this.H = f | 0;
151
+ }
152
+ process(t, n) {
153
+ for (let c = 0; c < 16; c++, n += 4)
154
+ d[c] = t.getUint32(n, !1);
155
+ for (let c = 16; c < 64; c++) {
156
+ const p = d[c - 15], l = d[c - 2], A = x(p, 7) ^ x(p, 18) ^ p >>> 3, g = x(l, 17) ^ x(l, 19) ^ l >>> 10;
157
+ d[c] = g + d[c - 7] + A + d[c - 16] | 0;
158
+ }
159
+ let { A: s, B: i, C: o, D: e, E: h, F: f, G: a, H: b } = this;
160
+ for (let c = 0; c < 64; c++) {
161
+ const p = x(h, 6) ^ x(h, 11) ^ x(h, 25), l = b + p + L(h, f, a) + E[c] + d[c] | 0, g = (x(s, 2) ^ x(s, 13) ^ x(s, 22)) + D(s, i, o) | 0;
162
+ b = a, a = f, f = h, h = e + l | 0, e = o, o = i, i = s, s = l + g | 0;
163
+ }
164
+ s = s + this.A | 0, i = i + this.B | 0, o = o + this.C | 0, e = e + this.D | 0, h = h + this.E | 0, f = f + this.F | 0, a = a + this.G | 0, b = b + this.H | 0, this.set(s, i, o, e, h, f, a, b);
165
+ }
166
+ roundClean() {
167
+ w(d);
168
+ }
169
+ destroy() {
170
+ this.set(0, 0, 0, 0, 0, 0, 0, 0), w(this.buffer);
171
+ }
172
+ }
173
+ const G = /* @__PURE__ */ C(() => new F()), M = G;
174
+ export {
175
+ k as H,
176
+ G as a,
177
+ M as s
178
+ };
@@ -0,0 +1,119 @@
1
+ const o = typeof globalThis == "object" && "crypto" in globalThis ? globalThis.crypto : void 0;
2
+ /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
3
+ function c(t) {
4
+ return t instanceof Uint8Array || ArrayBuffer.isView(t) && t.constructor.name === "Uint8Array";
5
+ }
6
+ function s(t) {
7
+ if (!Number.isSafeInteger(t) || t < 0)
8
+ throw new Error("positive integer expected, got " + t);
9
+ }
10
+ function i(t, ...e) {
11
+ if (!c(t))
12
+ throw new Error("Uint8Array expected");
13
+ if (e.length > 0 && !e.includes(t.length))
14
+ throw new Error("Uint8Array expected of length " + e + ", got length=" + t.length);
15
+ }
16
+ function d(t) {
17
+ if (typeof t != "function" || typeof t.create != "function")
18
+ throw new Error("Hash should be wrapped by utils.createHasher");
19
+ s(t.outputLen), s(t.blockLen);
20
+ }
21
+ function b(t, e = !0) {
22
+ if (t.destroyed)
23
+ throw new Error("Hash instance has been destroyed");
24
+ if (e && t.finished)
25
+ throw new Error("Hash#digest() has already been called");
26
+ }
27
+ function x(t, e) {
28
+ i(t);
29
+ const n = e.outputLen;
30
+ if (t.length < n)
31
+ throw new Error("digestInto() expects output buffer of length at least " + n);
32
+ }
33
+ function m(t) {
34
+ return new Uint32Array(t.buffer, t.byteOffset, Math.floor(t.byteLength / 4));
35
+ }
36
+ function A(...t) {
37
+ for (let e = 0; e < t.length; e++)
38
+ t[e].fill(0);
39
+ }
40
+ function U(t) {
41
+ return new DataView(t.buffer, t.byteOffset, t.byteLength);
42
+ }
43
+ function E(t, e) {
44
+ return t << 32 - e | t >>> e;
45
+ }
46
+ function H(t, e) {
47
+ return t << e | t >>> 32 - e >>> 0;
48
+ }
49
+ const a = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
50
+ function l(t) {
51
+ return t << 24 & 4278190080 | t << 8 & 16711680 | t >>> 8 & 65280 | t >>> 24 & 255;
52
+ }
53
+ function y(t) {
54
+ for (let e = 0; e < t.length; e++)
55
+ t[e] = l(t[e]);
56
+ return t;
57
+ }
58
+ const B = a ? (t) => t : y, h = /* @ts-ignore */ typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function", p = /* @__PURE__ */ Array.from({ length: 256 }, (t, e) => e.toString(16).padStart(2, "0"));
59
+ function L(t) {
60
+ if (i(t), h)
61
+ return t.toHex();
62
+ let e = "";
63
+ for (let n = 0; n < t.length; n++)
64
+ e += p[t[n]];
65
+ return e;
66
+ }
67
+ function g(t) {
68
+ if (typeof t != "string")
69
+ throw new Error("string expected");
70
+ return new Uint8Array(new TextEncoder().encode(t));
71
+ }
72
+ function w(t) {
73
+ return typeof t == "string" && (t = g(t)), i(t), t;
74
+ }
75
+ function T(...t) {
76
+ let e = 0;
77
+ for (let r = 0; r < t.length; r++) {
78
+ const f = t[r];
79
+ i(f), e += f.length;
80
+ }
81
+ const n = new Uint8Array(e);
82
+ for (let r = 0, f = 0; r < t.length; r++) {
83
+ const u = t[r];
84
+ n.set(u, f), f += u.length;
85
+ }
86
+ return n;
87
+ }
88
+ class V {
89
+ }
90
+ function S(t) {
91
+ const e = (r) => t().update(w(r)).digest(), n = t();
92
+ return e.outputLen = n.outputLen, e.blockLen = n.blockLen, e.create = () => t(), e;
93
+ }
94
+ function k(t = 32) {
95
+ if (o && typeof o.getRandomValues == "function")
96
+ return o.getRandomValues(new Uint8Array(t));
97
+ if (o && typeof o.randomBytes == "function")
98
+ return Uint8Array.from(o.randomBytes(t));
99
+ throw new Error("crypto.getRandomValues must be defined");
100
+ }
101
+ export {
102
+ V as H,
103
+ A as a,
104
+ L as b,
105
+ S as c,
106
+ d,
107
+ b as e,
108
+ i as f,
109
+ s as g,
110
+ k as h,
111
+ T as i,
112
+ U as j,
113
+ x as k,
114
+ E as l,
115
+ H as r,
116
+ B as s,
117
+ w as t,
118
+ m as u
119
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@springmicro/auth",
3
- "version": "0.7.20",
3
+ "version": "0.7.22",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -53,5 +53,5 @@
53
53
  "react-social-login-buttons": "^4.1.0",
54
54
  "uuid": "^9.0.1"
55
55
  },
56
- "gitHead": "17216b9fa5725017f185d210dc57dca36e02f43c"
56
+ "gitHead": "8bd83cea14b624431c069e6bebba77f858483da6"
57
57
  }
@@ -1,47 +0,0 @@
1
- import { H as u, h as l, t as H, e as r, b as p } from "./sha256-C90UGNQg.js";
2
- class o extends u {
3
- constructor(t, i) {
4
- super(), this.finished = !1, this.destroyed = !1, l(t);
5
- const h = H(i);
6
- if (this.iHash = t.create(), typeof this.iHash.update != "function")
7
- throw new Error("Expected instance of class which extends utils.Hash");
8
- this.blockLen = this.iHash.blockLen, this.outputLen = this.iHash.outputLen;
9
- const a = this.blockLen, e = new Uint8Array(a);
10
- e.set(h.length > a ? t.create().update(h).digest() : h);
11
- for (let s = 0; s < e.length; s++)
12
- e[s] ^= 54;
13
- this.iHash.update(e), this.oHash = t.create();
14
- for (let s = 0; s < e.length; s++)
15
- e[s] ^= 106;
16
- this.oHash.update(e), e.fill(0);
17
- }
18
- update(t) {
19
- return r(this), this.iHash.update(t), this;
20
- }
21
- digestInto(t) {
22
- r(this), p(t, this.outputLen), this.finished = !0, this.iHash.digestInto(t), this.oHash.update(t), this.oHash.digestInto(t), this.destroy();
23
- }
24
- digest() {
25
- const t = new Uint8Array(this.oHash.outputLen);
26
- return this.digestInto(t), t;
27
- }
28
- _cloneInto(t) {
29
- t || (t = Object.create(Object.getPrototypeOf(this), {}));
30
- const { oHash: i, iHash: h, finished: a, destroyed: e, blockLen: s, outputLen: c } = this;
31
- return t = t, t.finished = a, t.destroyed = e, t.blockLen = s, t.outputLen = c, t.oHash = i._cloneInto(t.oHash), t.iHash = h._cloneInto(t.iHash), t;
32
- }
33
- destroy() {
34
- this.destroyed = !0, this.oHash.destroy(), this.iHash.destroy();
35
- }
36
- }
37
- const d = (n, t, i) => new o(n, t).update(i).digest();
38
- d.create = (n, t) => new o(n, t);
39
- const y = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
40
- __proto__: null,
41
- HMAC: o,
42
- hmac: d
43
- }, Symbol.toStringTag, { value: "Module" }));
44
- export {
45
- y as a,
46
- d as h
47
- };