@coinbase/cdp-core 0.0.9 → 0.0.10
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/dist/esm/index100.js +7 -14
- package/dist/esm/index101.js +16 -80
- package/dist/esm/index102.js +72 -70
- package/dist/esm/index103.js +81 -0
- package/dist/esm/index13.js +18 -172
- package/dist/esm/index14.js +170 -39
- package/dist/esm/index15.js +158 -15
- package/dist/esm/index16.js +47 -4
- package/dist/esm/index17.js +146 -5
- package/dist/esm/index18.js +50 -154
- package/dist/esm/index19.js +39 -46
- package/dist/esm/index2.js +72 -68
- package/dist/esm/index20.js +16 -145
- package/dist/esm/index21.js +5 -56
- package/dist/esm/index22.js +5 -9
- package/dist/esm/index23.js +8 -17
- package/dist/esm/index24.js +16 -44
- package/dist/esm/index25.js +45 -13
- package/dist/esm/index26.js +13 -55
- package/dist/esm/index27.js +55 -6
- package/dist/esm/index28.js +6 -21
- package/dist/esm/index29.js +21 -11
- package/dist/esm/index3.js +4 -4
- package/dist/esm/index30.js +11 -3
- package/dist/esm/index31.js +3 -3
- package/dist/esm/index32.js +3 -34
- package/dist/esm/index33.js +32 -10
- package/dist/esm/index34.js +12 -4
- package/dist/esm/index35.js +4 -28
- package/dist/esm/index36.js +28 -6
- package/dist/esm/index37.js +6 -24
- package/dist/esm/index38.js +24 -16
- package/dist/esm/index39.js +16 -54
- package/dist/esm/index40.js +53 -22
- package/dist/esm/index41.js +23 -11
- package/dist/esm/index42.js +10 -26
- package/dist/esm/index43.js +26 -41
- package/dist/esm/index44.js +41 -54
- package/dist/esm/index45.js +54 -126
- package/dist/esm/index46.js +126 -11
- package/dist/esm/index47.js +9 -101
- package/dist/esm/index48.js +104 -6
- package/dist/esm/index49.js +7 -3
- package/dist/esm/index5.js +4 -4
- package/dist/esm/index50.js +3 -15
- package/dist/esm/index51.js +14 -42
- package/dist/esm/index52.js +38 -74
- package/dist/esm/index53.js +79 -2
- package/dist/esm/index54.js +2 -2
- package/dist/esm/index55.js +2 -13
- package/dist/esm/index56.js +8 -33
- package/dist/esm/index57.js +36 -5
- package/dist/esm/index58.js +5 -33
- package/dist/esm/index59.js +34 -8
- package/dist/esm/index60.js +8 -10
- package/dist/esm/index61.js +10 -11
- package/dist/esm/index62.js +11 -13
- package/dist/esm/index63.js +13 -18
- package/dist/esm/index64.js +18 -5
- package/dist/esm/index65.js +6 -5
- package/dist/esm/index66.js +5 -11
- package/dist/esm/index67.js +11 -2
- package/dist/esm/index68.js +13 -17
- package/dist/esm/index69.js +21 -15
- package/dist/esm/index70.js +49 -21
- package/dist/esm/index71.js +2 -51
- package/dist/esm/index72.js +18 -17
- package/dist/esm/index73.js +20 -80
- package/dist/esm/index74.js +79 -103
- package/dist/esm/index75.js +101 -30
- package/dist/esm/index76.js +32 -6
- package/dist/esm/index77.js +6 -54
- package/dist/esm/index78.js +10 -11
- package/dist/esm/index79.js +55 -2
- package/dist/esm/index80.js +11 -45
- package/dist/esm/index81.js +2 -14
- package/dist/esm/index82.js +44 -9
- package/dist/esm/index83.js +13 -78
- package/dist/esm/index84.js +79 -5
- package/dist/esm/index85.js +5 -21
- package/dist/esm/index86.js +12 -9
- package/dist/esm/index87.js +33 -17
- package/dist/esm/index88.js +41 -93
- package/dist/esm/index89.js +20 -20
- package/dist/esm/index90.js +9 -117
- package/dist/esm/index91.js +18 -11
- package/dist/esm/index92.js +90 -32
- package/dist/esm/index93.js +20 -41
- package/dist/esm/index94.js +118 -18
- package/dist/esm/index95.js +18 -28
- package/dist/esm/index96.js +26 -6
- package/dist/esm/index97.js +6 -9
- package/dist/esm/index98.js +11 -13
- package/dist/esm/index99.js +11 -8
- package/package.json +3 -3
package/dist/esm/index64.js
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { InvalidAddressError as s } from "./index56.js";
|
|
2
|
+
import { InvalidStorageKeySizeError as l } from "./index52.js";
|
|
3
|
+
import { isAddress as f } from "./index30.js";
|
|
4
|
+
function a(r) {
|
|
5
|
+
if (!r || r.length === 0)
|
|
6
|
+
return [];
|
|
7
|
+
const n = [];
|
|
8
|
+
for (let o = 0; o < r.length; o++) {
|
|
9
|
+
const { address: i, storageKeys: e } = r[o];
|
|
10
|
+
for (let t = 0; t < e.length; t++)
|
|
11
|
+
if (e[t].length - 2 !== 64)
|
|
12
|
+
throw new l({ storageKey: e[t] });
|
|
13
|
+
if (!f(i, { strict: !1 }))
|
|
14
|
+
throw new s({ address: i });
|
|
15
|
+
n.push([i, e]);
|
|
16
|
+
}
|
|
17
|
+
return n;
|
|
5
18
|
}
|
|
6
19
|
export {
|
|
7
|
-
|
|
20
|
+
a as serializeAccessList
|
|
8
21
|
};
|
package/dist/esm/index65.js
CHANGED
package/dist/esm/index66.js
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
let [l, e] = [
|
|
6
|
-
t.slice(0, t.length - n),
|
|
7
|
-
t.slice(t.length - n)
|
|
8
|
-
];
|
|
9
|
-
return e = e.replace(/(0+)$/, ""), `${i ? "-" : ""}${l || "0"}${e ? `.${e}` : ""}`;
|
|
10
|
-
}
|
|
1
|
+
const e = {
|
|
2
|
+
ether: -9,
|
|
3
|
+
wei: 9
|
|
4
|
+
};
|
|
11
5
|
export {
|
|
12
|
-
|
|
6
|
+
e as gweiUnits
|
|
13
7
|
};
|
package/dist/esm/index67.js
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
function a(r, n) {
|
|
2
|
+
let t = r.toString();
|
|
3
|
+
const i = t.startsWith("-");
|
|
4
|
+
i && (t = t.slice(1)), t = t.padStart(n, "0");
|
|
5
|
+
let [l, e] = [
|
|
6
|
+
t.slice(0, t.length - n),
|
|
7
|
+
t.slice(t.length - n)
|
|
8
|
+
];
|
|
9
|
+
return e = e.replace(/(0+)$/, ""), `${i ? "-" : ""}${l || "0"}${e ? `.${e}` : ""}`;
|
|
10
|
+
}
|
|
2
11
|
export {
|
|
3
|
-
|
|
12
|
+
a as formatUnits
|
|
4
13
|
};
|
package/dist/esm/index68.js
CHANGED
|
@@ -1,23 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
class
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
});
|
|
1
|
+
import { FlattenedSign as n } from "./index79.js";
|
|
2
|
+
class o {
|
|
3
|
+
#e;
|
|
4
|
+
constructor(e) {
|
|
5
|
+
this.#e = new n(e);
|
|
7
6
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
constructor({ length: e, position: r }) {
|
|
11
|
-
super(`Position \`${r}\` is out of bounds (\`0 < position < ${e}\`).`, { name: "PositionOutOfBoundsError" });
|
|
7
|
+
setProtectedHeader(e) {
|
|
8
|
+
return this.#e.setProtectedHeader(e), this;
|
|
12
9
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
async sign(e, r) {
|
|
11
|
+
const t = await this.#e.sign(e, r);
|
|
12
|
+
if (t.payload === void 0)
|
|
13
|
+
throw new TypeError("use the flattened module for creating JWS with b64: false");
|
|
14
|
+
return `${t.protected}.${t.payload}.${t.signature}`;
|
|
17
15
|
}
|
|
18
16
|
}
|
|
19
17
|
export {
|
|
20
|
-
|
|
21
|
-
n as PositionOutOfBoundsError,
|
|
22
|
-
c as RecursiveReadLimitExceededError
|
|
18
|
+
o as CompactSign
|
|
23
19
|
};
|
package/dist/esm/index69.js
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
constructor(e) {
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
setProtectedHeader(e) {
|
|
8
|
-
return this.#e.setProtectedHeader(e), this;
|
|
9
|
-
}
|
|
10
|
-
async sign(e, r) {
|
|
11
|
-
const t = await this.#e.sign(e, r);
|
|
12
|
-
if (t.payload === void 0)
|
|
13
|
-
throw new TypeError("use the flattened module for creating JWS with b64: false");
|
|
14
|
-
return `${t.protected}.${t.payload}.${t.signature}`;
|
|
1
|
+
class c extends Error {
|
|
2
|
+
static code = "ERR_JOSE_GENERIC";
|
|
3
|
+
code = "ERR_JOSE_GENERIC";
|
|
4
|
+
constructor(s, e) {
|
|
5
|
+
super(s, e), this.name = this.constructor.name, Error.captureStackTrace?.(this, this.constructor);
|
|
15
6
|
}
|
|
16
7
|
}
|
|
8
|
+
class E extends c {
|
|
9
|
+
static code = "ERR_JOSE_NOT_SUPPORTED";
|
|
10
|
+
code = "ERR_JOSE_NOT_SUPPORTED";
|
|
11
|
+
}
|
|
12
|
+
class o extends c {
|
|
13
|
+
static code = "ERR_JWS_INVALID";
|
|
14
|
+
code = "ERR_JWS_INVALID";
|
|
15
|
+
}
|
|
16
|
+
class r extends c {
|
|
17
|
+
static code = "ERR_JWT_INVALID";
|
|
18
|
+
code = "ERR_JWT_INVALID";
|
|
19
|
+
}
|
|
17
20
|
export {
|
|
18
|
-
|
|
21
|
+
c as JOSEError,
|
|
22
|
+
E as JOSENotSupported,
|
|
23
|
+
o as JWSInvalid,
|
|
24
|
+
r as JWTInvalid
|
|
19
25
|
};
|
package/dist/esm/index70.js
CHANGED
|
@@ -1,25 +1,53 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
static code = "ERR_JOSE_NOT_SUPPORTED";
|
|
10
|
-
code = "ERR_JOSE_NOT_SUPPORTED";
|
|
1
|
+
import { encoder as n } from "./index80.js";
|
|
2
|
+
import e from "./index81.js";
|
|
3
|
+
import i from "./index82.js";
|
|
4
|
+
import o from "./index83.js";
|
|
5
|
+
function s(r, t) {
|
|
6
|
+
if (!Number.isFinite(t))
|
|
7
|
+
throw new TypeError(`Invalid ${r} input`);
|
|
8
|
+
return t;
|
|
11
9
|
}
|
|
12
|
-
class
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
class d {
|
|
11
|
+
#t;
|
|
12
|
+
constructor(t) {
|
|
13
|
+
if (!o(t))
|
|
14
|
+
throw new TypeError("JWT Claims Set MUST be an object");
|
|
15
|
+
this.#t = structuredClone(t);
|
|
16
|
+
}
|
|
17
|
+
data() {
|
|
18
|
+
return n.encode(JSON.stringify(this.#t));
|
|
19
|
+
}
|
|
20
|
+
get iss() {
|
|
21
|
+
return this.#t.iss;
|
|
22
|
+
}
|
|
23
|
+
set iss(t) {
|
|
24
|
+
this.#t.iss = t;
|
|
25
|
+
}
|
|
26
|
+
get sub() {
|
|
27
|
+
return this.#t.sub;
|
|
28
|
+
}
|
|
29
|
+
set sub(t) {
|
|
30
|
+
this.#t.sub = t;
|
|
31
|
+
}
|
|
32
|
+
get aud() {
|
|
33
|
+
return this.#t.aud;
|
|
34
|
+
}
|
|
35
|
+
set aud(t) {
|
|
36
|
+
this.#t.aud = t;
|
|
37
|
+
}
|
|
38
|
+
set jti(t) {
|
|
39
|
+
this.#t.jti = t;
|
|
40
|
+
}
|
|
41
|
+
set nbf(t) {
|
|
42
|
+
typeof t == "number" ? this.#t.nbf = s("setNotBefore", t) : t instanceof Date ? this.#t.nbf = s("setNotBefore", e(t)) : this.#t.nbf = e(/* @__PURE__ */ new Date()) + i(t);
|
|
43
|
+
}
|
|
44
|
+
set exp(t) {
|
|
45
|
+
typeof t == "number" ? this.#t.exp = s("setExpirationTime", t) : t instanceof Date ? this.#t.exp = s("setExpirationTime", e(t)) : this.#t.exp = e(/* @__PURE__ */ new Date()) + i(t);
|
|
46
|
+
}
|
|
47
|
+
set iat(t) {
|
|
48
|
+
typeof t > "u" ? this.#t.iat = e(/* @__PURE__ */ new Date()) : t instanceof Date ? this.#t.iat = s("setIssuedAt", e(t)) : typeof t == "string" ? this.#t.iat = s("setIssuedAt", e(/* @__PURE__ */ new Date()) + i(t)) : this.#t.iat = s("setIssuedAt", t);
|
|
49
|
+
}
|
|
19
50
|
}
|
|
20
51
|
export {
|
|
21
|
-
|
|
22
|
-
E as JOSENotSupported,
|
|
23
|
-
o as JWSInvalid,
|
|
24
|
-
r as JWTInvalid
|
|
52
|
+
d as JWTClaimsBuilder
|
|
25
53
|
};
|
package/dist/esm/index71.js
CHANGED
|
@@ -1,53 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import e from "./index79.js";
|
|
3
|
-
import i from "./index80.js";
|
|
4
|
-
import o from "./index81.js";
|
|
5
|
-
function s(r, t) {
|
|
6
|
-
if (!Number.isFinite(t))
|
|
7
|
-
throw new TypeError(`Invalid ${r} input`);
|
|
8
|
-
return t;
|
|
9
|
-
}
|
|
10
|
-
class d {
|
|
11
|
-
#t;
|
|
12
|
-
constructor(t) {
|
|
13
|
-
if (!o(t))
|
|
14
|
-
throw new TypeError("JWT Claims Set MUST be an object");
|
|
15
|
-
this.#t = structuredClone(t);
|
|
16
|
-
}
|
|
17
|
-
data() {
|
|
18
|
-
return n.encode(JSON.stringify(this.#t));
|
|
19
|
-
}
|
|
20
|
-
get iss() {
|
|
21
|
-
return this.#t.iss;
|
|
22
|
-
}
|
|
23
|
-
set iss(t) {
|
|
24
|
-
this.#t.iss = t;
|
|
25
|
-
}
|
|
26
|
-
get sub() {
|
|
27
|
-
return this.#t.sub;
|
|
28
|
-
}
|
|
29
|
-
set sub(t) {
|
|
30
|
-
this.#t.sub = t;
|
|
31
|
-
}
|
|
32
|
-
get aud() {
|
|
33
|
-
return this.#t.aud;
|
|
34
|
-
}
|
|
35
|
-
set aud(t) {
|
|
36
|
-
this.#t.aud = t;
|
|
37
|
-
}
|
|
38
|
-
set jti(t) {
|
|
39
|
-
this.#t.jti = t;
|
|
40
|
-
}
|
|
41
|
-
set nbf(t) {
|
|
42
|
-
typeof t == "number" ? this.#t.nbf = s("setNotBefore", t) : t instanceof Date ? this.#t.nbf = s("setNotBefore", e(t)) : this.#t.nbf = e(/* @__PURE__ */ new Date()) + i(t);
|
|
43
|
-
}
|
|
44
|
-
set exp(t) {
|
|
45
|
-
typeof t == "number" ? this.#t.exp = s("setExpirationTime", t) : t instanceof Date ? this.#t.exp = s("setExpirationTime", e(t)) : this.#t.exp = e(/* @__PURE__ */ new Date()) + i(t);
|
|
46
|
-
}
|
|
47
|
-
set iat(t) {
|
|
48
|
-
typeof t > "u" ? this.#t.iat = e(/* @__PURE__ */ new Date()) : t instanceof Date ? this.#t.iat = s("setIssuedAt", e(t)) : typeof t == "string" ? this.#t.iat = s("setIssuedAt", e(/* @__PURE__ */ new Date()) + i(t)) : this.#t.iat = s("setIssuedAt", t);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
1
|
+
const o = "2.33.0";
|
|
51
2
|
export {
|
|
52
|
-
|
|
3
|
+
o as version
|
|
53
4
|
};
|
package/dist/esm/index72.js
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { BaseError as o } from "./index45.js";
|
|
2
|
+
class i extends o {
|
|
3
|
+
constructor({ offset: e }) {
|
|
4
|
+
super(`Offset \`${e}\` cannot be negative.`, {
|
|
5
|
+
name: "NegativeOffsetError"
|
|
6
|
+
});
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
class n extends o {
|
|
10
|
+
constructor({ length: e, position: r }) {
|
|
11
|
+
super(`Position \`${r}\` is out of bounds (\`0 < position < ${e}\`).`, { name: "PositionOutOfBoundsError" });
|
|
12
|
+
}
|
|
4
13
|
}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
for (let e = 0; e < n; e++) {
|
|
9
|
-
const { h: u, l: f } = s(t[e], r);
|
|
10
|
-
[l[e], c[e]] = [u, f];
|
|
14
|
+
class c extends o {
|
|
15
|
+
constructor({ count: e, limit: r }) {
|
|
16
|
+
super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${e}\`).`, { name: "RecursiveReadLimitExceededError" });
|
|
11
17
|
}
|
|
12
|
-
return [l, c];
|
|
13
18
|
}
|
|
14
|
-
const m = (t, r, n) => t << n | r >>> 32 - n, A = (t, r, n) => r << n | t >>> 32 - n, B = (t, r, n) => r << n - 32 | t >>> 64 - n, a = (t, r, n) => t << n - 32 | r >>> 64 - n;
|
|
15
19
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
m as rotlSH,
|
|
20
|
-
A as rotlSL,
|
|
21
|
-
h as split
|
|
20
|
+
i as NegativeOffsetError,
|
|
21
|
+
n as PositionOutOfBoundsError,
|
|
22
|
+
c as RecursiveReadLimitExceededError
|
|
22
23
|
};
|
package/dist/esm/index73.js
CHANGED
|
@@ -1,82 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
function
|
|
3
|
-
return
|
|
4
|
-
}
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
function h(e, t = !0) {
|
|
16
|
-
if (e.destroyed)
|
|
17
|
-
throw new Error("Hash instance has been destroyed");
|
|
18
|
-
if (t && e.finished)
|
|
19
|
-
throw new Error("Hash#digest() has already been called");
|
|
20
|
-
}
|
|
21
|
-
function l(e, t) {
|
|
22
|
-
r(e);
|
|
23
|
-
const n = t.outputLen;
|
|
24
|
-
if (e.length < n)
|
|
25
|
-
throw new Error("digestInto() expects output buffer of length at least " + n);
|
|
26
|
-
}
|
|
27
|
-
function a(e) {
|
|
28
|
-
return new Uint32Array(e.buffer, e.byteOffset, Math.floor(e.byteLength / 4));
|
|
29
|
-
}
|
|
30
|
-
function g(...e) {
|
|
31
|
-
for (let t = 0; t < e.length; t++)
|
|
32
|
-
e[t].fill(0);
|
|
33
|
-
}
|
|
34
|
-
function p(e) {
|
|
35
|
-
return new DataView(e.buffer, e.byteOffset, e.byteLength);
|
|
36
|
-
}
|
|
37
|
-
function b(e, t) {
|
|
38
|
-
return e << 32 - t | e >>> t;
|
|
39
|
-
}
|
|
40
|
-
const i = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
|
|
41
|
-
function u(e) {
|
|
42
|
-
return e << 24 & 4278190080 | e << 8 & 16711680 | e >>> 8 & 65280 | e >>> 24 & 255;
|
|
43
|
-
}
|
|
44
|
-
function c(e) {
|
|
45
|
-
for (let t = 0; t < e.length; t++)
|
|
46
|
-
e[t] = u(e[t]);
|
|
47
|
-
return e;
|
|
48
|
-
}
|
|
49
|
-
const x = i ? (e) => e : c;
|
|
50
|
-
function s(e) {
|
|
51
|
-
if (typeof e != "string")
|
|
52
|
-
throw new Error("string expected");
|
|
53
|
-
return new Uint8Array(new TextEncoder().encode(e));
|
|
54
|
-
}
|
|
55
|
-
function y(e) {
|
|
56
|
-
return typeof e == "string" && (e = s(e)), r(e), e;
|
|
57
|
-
}
|
|
58
|
-
class d {
|
|
59
|
-
}
|
|
60
|
-
function E(e) {
|
|
61
|
-
const t = (f) => e().update(y(f)).digest(), n = e();
|
|
62
|
-
return t.outputLen = n.outputLen, t.blockLen = n.blockLen, t.create = () => e(), t;
|
|
63
|
-
}
|
|
1
|
+
const o = /* @__PURE__ */ BigInt(4294967295), i = /* @__PURE__ */ BigInt(32);
|
|
2
|
+
function s(t, r = !1) {
|
|
3
|
+
return r ? { h: Number(t & o), l: Number(t >> i & o) } : { h: Number(t >> i & o) | 0, l: Number(t & o) | 0 };
|
|
4
|
+
}
|
|
5
|
+
function h(t, r = !1) {
|
|
6
|
+
const n = t.length;
|
|
7
|
+
let l = new Uint32Array(n), c = new Uint32Array(n);
|
|
8
|
+
for (let e = 0; e < n; e++) {
|
|
9
|
+
const { h: u, l: f } = s(t[e], r);
|
|
10
|
+
[l[e], c[e]] = [u, f];
|
|
11
|
+
}
|
|
12
|
+
return [l, c];
|
|
13
|
+
}
|
|
14
|
+
const m = (t, r, n) => t << n | r >>> 32 - n, A = (t, r, n) => r << n | t >>> 32 - n, B = (t, r, n) => r << n - 32 | t >>> 64 - n, a = (t, r, n) => t << n - 32 | r >>> 64 - n;
|
|
64
15
|
export {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
c as byteSwap32,
|
|
72
|
-
g as clean,
|
|
73
|
-
E as createHasher,
|
|
74
|
-
p as createView,
|
|
75
|
-
o as isBytes,
|
|
76
|
-
i as isLE,
|
|
77
|
-
b as rotr,
|
|
78
|
-
x as swap32IfBE,
|
|
79
|
-
y as toBytes,
|
|
80
|
-
a as u32,
|
|
81
|
-
s as utf8ToBytes
|
|
16
|
+
s as fromBig,
|
|
17
|
+
B as rotlBH,
|
|
18
|
+
a as rotlBL,
|
|
19
|
+
m as rotlSH,
|
|
20
|
+
A as rotlSL,
|
|
21
|
+
h as split
|
|
82
22
|
};
|
package/dist/esm/index74.js
CHANGED
|
@@ -1,106 +1,82 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
2361852424,
|
|
64
|
-
2428436474,
|
|
65
|
-
2756734187,
|
|
66
|
-
3204031479,
|
|
67
|
-
3329325298
|
|
68
|
-
]), h = /* @__PURE__ */ new Uint32Array(64);
|
|
69
|
-
class E extends D {
|
|
70
|
-
constructor(o = 32) {
|
|
71
|
-
super(64, o, 8, !1), this.A = b[0] | 0, this.B = b[1] | 0, this.C = b[2] | 0, this.D = b[3] | 0, this.E = b[4] | 0, this.F = b[5] | 0, this.G = b[6] | 0, this.H = b[7] | 0;
|
|
72
|
-
}
|
|
73
|
-
get() {
|
|
74
|
-
const { A: o, B: r, C: t, D: s, E: a, F: f, G: c, H: e } = this;
|
|
75
|
-
return [o, r, t, s, a, f, c, e];
|
|
76
|
-
}
|
|
77
|
-
// prettier-ignore
|
|
78
|
-
set(o, r, t, s, a, f, c, e) {
|
|
79
|
-
this.A = o | 0, this.B = r | 0, this.C = t | 0, this.D = s | 0, this.E = a | 0, this.F = f | 0, this.G = c | 0, this.H = e | 0;
|
|
80
|
-
}
|
|
81
|
-
process(o, r) {
|
|
82
|
-
for (let x = 0; x < 16; x++, r += 4)
|
|
83
|
-
h[x] = o.getUint32(r, !1);
|
|
84
|
-
for (let x = 16; x < 64; x++) {
|
|
85
|
-
const H = h[x - 15], d = h[x - 2], m = i(H, 7) ^ i(H, 18) ^ H >>> 3, l = i(d, 17) ^ i(d, 19) ^ d >>> 10;
|
|
86
|
-
h[x] = l + h[x - 7] + m + h[x - 16] | 0;
|
|
87
|
-
}
|
|
88
|
-
let { A: t, B: s, C: a, D: f, E: c, F: e, G: n, H: A } = this;
|
|
89
|
-
for (let x = 0; x < 64; x++) {
|
|
90
|
-
const H = i(c, 6) ^ i(c, 11) ^ i(c, 25), d = A + H + g(c, e, n) + B[x] + h[x] | 0, l = (i(t, 2) ^ i(t, 13) ^ i(t, 22)) + p(t, s, a) | 0;
|
|
91
|
-
A = n, n = e, e = c, c = f + d | 0, f = a, a = s, s = t, t = d + l | 0;
|
|
92
|
-
}
|
|
93
|
-
t = t + this.A | 0, s = s + this.B | 0, a = a + this.C | 0, f = f + this.D | 0, c = c + this.E | 0, e = e + this.F | 0, n = n + this.G | 0, A = A + this.H | 0, this.set(t, s, a, f, c, e, n, A);
|
|
94
|
-
}
|
|
95
|
-
roundClean() {
|
|
96
|
-
C(h);
|
|
97
|
-
}
|
|
98
|
-
destroy() {
|
|
99
|
-
this.set(0, 0, 0, 0, 0, 0, 0, 0), C(this.buffer);
|
|
100
|
-
}
|
|
1
|
+
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
2
|
+
function o(e) {
|
|
3
|
+
return e instanceof Uint8Array || ArrayBuffer.isView(e) && e.constructor.name === "Uint8Array";
|
|
4
|
+
}
|
|
5
|
+
function w(e) {
|
|
6
|
+
if (!Number.isSafeInteger(e) || e < 0)
|
|
7
|
+
throw new Error("positive integer expected, got " + e);
|
|
8
|
+
}
|
|
9
|
+
function r(e, ...t) {
|
|
10
|
+
if (!o(e))
|
|
11
|
+
throw new Error("Uint8Array expected");
|
|
12
|
+
if (t.length > 0 && !t.includes(e.length))
|
|
13
|
+
throw new Error("Uint8Array expected of length " + t + ", got length=" + e.length);
|
|
14
|
+
}
|
|
15
|
+
function h(e, t = !0) {
|
|
16
|
+
if (e.destroyed)
|
|
17
|
+
throw new Error("Hash instance has been destroyed");
|
|
18
|
+
if (t && e.finished)
|
|
19
|
+
throw new Error("Hash#digest() has already been called");
|
|
20
|
+
}
|
|
21
|
+
function l(e, t) {
|
|
22
|
+
r(e);
|
|
23
|
+
const n = t.outputLen;
|
|
24
|
+
if (e.length < n)
|
|
25
|
+
throw new Error("digestInto() expects output buffer of length at least " + n);
|
|
26
|
+
}
|
|
27
|
+
function a(e) {
|
|
28
|
+
return new Uint32Array(e.buffer, e.byteOffset, Math.floor(e.byteLength / 4));
|
|
29
|
+
}
|
|
30
|
+
function g(...e) {
|
|
31
|
+
for (let t = 0; t < e.length; t++)
|
|
32
|
+
e[t].fill(0);
|
|
33
|
+
}
|
|
34
|
+
function p(e) {
|
|
35
|
+
return new DataView(e.buffer, e.byteOffset, e.byteLength);
|
|
36
|
+
}
|
|
37
|
+
function b(e, t) {
|
|
38
|
+
return e << 32 - t | e >>> t;
|
|
39
|
+
}
|
|
40
|
+
const i = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
|
|
41
|
+
function u(e) {
|
|
42
|
+
return e << 24 & 4278190080 | e << 8 & 16711680 | e >>> 8 & 65280 | e >>> 24 & 255;
|
|
43
|
+
}
|
|
44
|
+
function c(e) {
|
|
45
|
+
for (let t = 0; t < e.length; t++)
|
|
46
|
+
e[t] = u(e[t]);
|
|
47
|
+
return e;
|
|
48
|
+
}
|
|
49
|
+
const x = i ? (e) => e : c;
|
|
50
|
+
function s(e) {
|
|
51
|
+
if (typeof e != "string")
|
|
52
|
+
throw new Error("string expected");
|
|
53
|
+
return new Uint8Array(new TextEncoder().encode(e));
|
|
54
|
+
}
|
|
55
|
+
function y(e) {
|
|
56
|
+
return typeof e == "string" && (e = s(e)), r(e), e;
|
|
57
|
+
}
|
|
58
|
+
class d {
|
|
59
|
+
}
|
|
60
|
+
function E(e) {
|
|
61
|
+
const t = (f) => e().update(y(f)).digest(), n = e();
|
|
62
|
+
return t.outputLen = n.outputLen, t.blockLen = n.blockLen, t.create = () => e(), t;
|
|
101
63
|
}
|
|
102
|
-
const y = /* @__PURE__ */ u(() => new E());
|
|
103
64
|
export {
|
|
104
|
-
|
|
105
|
-
|
|
65
|
+
d as Hash,
|
|
66
|
+
r as abytes,
|
|
67
|
+
h as aexists,
|
|
68
|
+
w as anumber,
|
|
69
|
+
l as aoutput,
|
|
70
|
+
u as byteSwap,
|
|
71
|
+
c as byteSwap32,
|
|
72
|
+
g as clean,
|
|
73
|
+
E as createHasher,
|
|
74
|
+
p as createView,
|
|
75
|
+
o as isBytes,
|
|
76
|
+
i as isLE,
|
|
77
|
+
b as rotr,
|
|
78
|
+
x as swap32IfBE,
|
|
79
|
+
y as toBytes,
|
|
80
|
+
a as u32,
|
|
81
|
+
s as utf8ToBytes
|
|
106
82
|
};
|