@forestrie/merklelog 0.0.2 → 0.0.3
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"algorithms-sync.d.ts","sourceRoot":"","sources":["../../src/mmr/algorithms-sync.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAazC;;;;;;GAMG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"algorithms-sync.d.ts","sourceRoot":"","sources":["../../src/mmr/algorithms-sync.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAazC;;;;;;GAMG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC,CAuBxD"}
|
|
@@ -23,7 +23,13 @@ function concatChunks(chunks) {
|
|
|
23
23
|
* Only available in Node.js; throws if node:crypto is not available.
|
|
24
24
|
*/
|
|
25
25
|
export async function createSyncHasher() {
|
|
26
|
-
|
|
26
|
+
// Keep the specifier opaque so bundlers do not resolve node:crypto at
|
|
27
|
+
// build time: this factory is documented runtime-guarded Node-only, and
|
|
28
|
+
// browser consumers of the package index (e.g. @forestrie/receipt-verify's
|
|
29
|
+
// ADR-0048 browser-safety guard) must not get node builtins in their
|
|
30
|
+
// module graph merely by importing it.
|
|
31
|
+
const nodeCryptoSpecifier = "node:crypto";
|
|
32
|
+
const { createHash } = await import(/* @vite-ignore */ nodeCryptoSpecifier);
|
|
27
33
|
const chunks = [];
|
|
28
34
|
return {
|
|
29
35
|
reset() {
|
package/package.json
CHANGED
|
@@ -27,7 +27,13 @@ function concatChunks(chunks: Uint8Array[]): Uint8Array {
|
|
|
27
27
|
* Only available in Node.js; throws if node:crypto is not available.
|
|
28
28
|
*/
|
|
29
29
|
export async function createSyncHasher(): Promise<Hasher> {
|
|
30
|
-
|
|
30
|
+
// Keep the specifier opaque so bundlers do not resolve node:crypto at
|
|
31
|
+
// build time: this factory is documented runtime-guarded Node-only, and
|
|
32
|
+
// browser consumers of the package index (e.g. @forestrie/receipt-verify's
|
|
33
|
+
// ADR-0048 browser-safety guard) must not get node builtins in their
|
|
34
|
+
// module graph merely by importing it.
|
|
35
|
+
const nodeCryptoSpecifier = "node:crypto";
|
|
36
|
+
const { createHash } = await import(/* @vite-ignore */ nodeCryptoSpecifier);
|
|
31
37
|
const chunks: Uint8Array[] = [];
|
|
32
38
|
return {
|
|
33
39
|
reset(): void {
|