nano-pow 4.0.8 → 4.0.9
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/bin/server.js +3 -2
- package/package.json +1 -1
package/dist/bin/server.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
//! SPDX-FileCopyrightText: 2025 Chris Duncan <chris@zoso.dev>
|
|
3
3
|
//! SPDX-License-Identifier: GPL-3.0-or-later
|
|
4
|
-
import { readFile, unlink, writeFile } from "node:fs/promises";
|
|
5
4
|
import { launch } from "puppeteer";
|
|
5
|
+
import { subtle } from "node:crypto";
|
|
6
6
|
import { lookup } from "node:dns/promises";
|
|
7
|
+
import { readFile, unlink, writeFile } from "node:fs/promises";
|
|
7
8
|
import * as http from "node:http";
|
|
8
9
|
import { hostname } from "node:os";
|
|
9
10
|
import { join } from "node:path";
|
|
@@ -147,7 +148,7 @@ await page.waitForFunction(async () => {
|
|
|
147
148
|
return await navigator["gpu"].requestAdapter();
|
|
148
149
|
});
|
|
149
150
|
const src = `${NanoPow};window.NanoPow=NanoPow;`;
|
|
150
|
-
const hash = await
|
|
151
|
+
const hash = await subtle.digest("SHA-256", Buffer.from(src));
|
|
151
152
|
const enc = `sha256-${Buffer.from(hash).toString("base64")}`;
|
|
152
153
|
await page.setContent(`
|
|
153
154
|
<!DOCTYPE html>
|