@palbase/web 7.3.1 → 7.3.2
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/{chunk-53TN7KYR.js → chunk-HKZVA3I3.js} +11 -2
- package/dist/chunk-HKZVA3I3.js.map +1 -0
- package/dist/{chunk-CBN3PWNL.js → chunk-OZLTH7YB.js} +2 -2
- package/dist/{chunk-RRHJV6YD.js → chunk-TQAQR3OP.js} +3 -3
- package/dist/{chunk-RRHJV6YD.js.map → chunk-TQAQR3OP.js.map} +1 -1
- package/dist/index.cjs +11 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/internal.cjs +11 -2
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.js +2 -2
- package/dist/next/client.cjs +11 -2
- package/dist/next/client.cjs.map +1 -1
- package/dist/next/client.js +2 -2
- package/dist/next/index.cjs +11 -2
- package/dist/next/index.cjs.map +1 -1
- package/dist/next/index.js +3 -3
- package/dist/next/proxy.js +2 -2
- package/dist/react/index.cjs +11 -2
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-53TN7KYR.js.map +0 -1
- /package/dist/{chunk-CBN3PWNL.js.map → chunk-OZLTH7YB.js.map} +0 -0
package/dist/internal.js
CHANGED
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
createBoundClient,
|
|
7
7
|
getRuntime,
|
|
8
8
|
onConfigured
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-TQAQR3OP.js";
|
|
10
|
+
import "./chunk-HKZVA3I3.js";
|
|
11
11
|
import "./chunk-CFDU23TB.js";
|
|
12
12
|
import "./chunk-PZ5AY32C.js";
|
|
13
13
|
export {
|
package/dist/next/client.cjs
CHANGED
|
@@ -81,7 +81,16 @@ function leadingZeroBits(hash) {
|
|
|
81
81
|
}
|
|
82
82
|
return bits;
|
|
83
83
|
}
|
|
84
|
-
|
|
84
|
+
var MAX_POW_DIFFICULTY = 24;
|
|
85
|
+
function powBudget(difficulty) {
|
|
86
|
+
return 8 * 2 ** difficulty;
|
|
87
|
+
}
|
|
88
|
+
async function solvePowChallenge(challenge, maxIterations = powBudget(challenge.difficulty)) {
|
|
89
|
+
if (challenge.difficulty > MAX_POW_DIFFICULTY) {
|
|
90
|
+
throw new Error(
|
|
91
|
+
`proof-of-work: refusing difficulty ${challenge.difficulty}; this client attempts at most ${MAX_POW_DIFFICULTY}, which is the highest a Palbase stack issues`
|
|
92
|
+
);
|
|
93
|
+
}
|
|
85
94
|
for (let nonce = 0; nonce < maxIterations; nonce++) {
|
|
86
95
|
const digest = await crypto.subtle.digest("SHA-256", encoder.encode(challenge.prefix + nonce));
|
|
87
96
|
if (leadingZeroBits(new Uint8Array(digest)) >= challenge.difficulty) {
|
|
@@ -9155,7 +9164,7 @@ function defaultSessionStorage(key) {
|
|
|
9155
9164
|
}
|
|
9156
9165
|
|
|
9157
9166
|
// src/version.ts
|
|
9158
|
-
var VERSION = "7.3.
|
|
9167
|
+
var VERSION = "7.3.2";
|
|
9159
9168
|
|
|
9160
9169
|
// src/runtime.ts
|
|
9161
9170
|
function buildRuntime(config) {
|