public
anord
read
Ledger
Why work hard when you can work easier?
Languages
Repository composition by tracked source files.
TypeScript
86%
CSS
10%
SQL
3%
Shell
1%
HTML
0%
Trace
apps/api/src/utils/webhook.ts
Trace helps you understand code history line by line. See who changed each line, when it changed, and which commit introduced it.
Author
Date
Commit
Line
Code
1
import crypto from "node:crypto";
3
export function signWebhook(secret: string, body: string): string {
4
return crypto.createHmac("sha256", secret).update(body).digest("hex");
5
}
7
export function buildSignedWebhookBody(secret: string, timestamp: string, body: string) {
8
return signWebhook(secret, `${timestamp}.${body}`);
9
}