@gethashd/bytecave-browser 1.0.34 → 1.0.35
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-EDVNOZ7Q.js → chunk-PMRP2UEN.js} +3 -1
- package/dist/index.cjs +3 -1
- package/dist/index.js +1 -1
- package/dist/react/index.js +1 -1
- package/package.json +1 -1
- package/src/client.ts +4 -1
|
@@ -6507,7 +6507,9 @@ var ByteCaveClient = class {
|
|
|
6507
6507
|
try {
|
|
6508
6508
|
const { ethers: ethers3 } = await import("ethers");
|
|
6509
6509
|
const sender = await signer.getAddress();
|
|
6510
|
-
const
|
|
6510
|
+
const hashBuffer = await crypto.subtle.digest("SHA-256", dataArray);
|
|
6511
|
+
const hashArray = Array.from(new Uint8Array(hashBuffer));
|
|
6512
|
+
const contentHash = "0x" + hashArray.map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
6511
6513
|
const timestamp = Date.now();
|
|
6512
6514
|
const nonce = Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
|
|
6513
6515
|
const message2 = `ByteCave Storage Request for:
|
package/dist/index.cjs
CHANGED
|
@@ -6560,7 +6560,9 @@ var ByteCaveClient = class {
|
|
|
6560
6560
|
try {
|
|
6561
6561
|
const { ethers: ethers3 } = await import("ethers");
|
|
6562
6562
|
const sender = await signer.getAddress();
|
|
6563
|
-
const
|
|
6563
|
+
const hashBuffer = await crypto.subtle.digest("SHA-256", dataArray);
|
|
6564
|
+
const hashArray = Array.from(new Uint8Array(hashBuffer));
|
|
6565
|
+
const contentHash = "0x" + hashArray.map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
6564
6566
|
const timestamp = Date.now();
|
|
6565
6567
|
const nonce = Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
|
|
6566
6568
|
const message2 = `ByteCave Storage Request for:
|
package/dist/index.js
CHANGED
package/dist/react/index.js
CHANGED
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -445,7 +445,10 @@ export class ByteCaveClient {
|
|
|
445
445
|
const { ethers } = await import('ethers');
|
|
446
446
|
|
|
447
447
|
const sender = await signer.getAddress();
|
|
448
|
-
|
|
448
|
+
// Use SHA-256 to match what the node calculates
|
|
449
|
+
const hashBuffer = await crypto.subtle.digest('SHA-256', dataArray as BufferSource);
|
|
450
|
+
const hashArray = Array.from(new Uint8Array(hashBuffer));
|
|
451
|
+
const contentHash = '0x' + hashArray.map(b => b.toString(16).padStart(2, '0')).join('');
|
|
449
452
|
const timestamp = Date.now();
|
|
450
453
|
const nonce = Math.random().toString(36).substring(2, 15) +
|
|
451
454
|
Math.random().toString(36).substring(2, 15);
|