Skip to content

Commit 5d0bb9d

Browse files
committed
add get_webhook script
1 parent 54fc8f1 commit 5d0bb9d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

get_webhook.mjs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import process from "process";
2+
3+
const sha256 = async (text) =>
4+
crypto.subtle
5+
.digest("SHA-256", new TextEncoder().encode(text))
6+
.then((array_buffer) =>
7+
Array.from(new Uint8Array(array_buffer))
8+
.map((b) => b.toString(16).padStart(2, "0"))
9+
.join("")
10+
);
11+
12+
const base_url = process.argv[2];
13+
const token = process.argv[3];
14+
const path = await sha256(token);
15+
16+
console.log(base_url + path);

0 commit comments

Comments
 (0)