try to fix hashing

This commit is contained in:
Moon Man 2023-12-27 11:23:44 -05:00
parent 726c612b52
commit 504f76649b
1 changed files with 1 additions and 3 deletions

View File

@ -1,10 +1,8 @@
import { createHash } from "node:crypto";
const hasher = createHash("sha256");
export const hashDigest = (payload: string | Buffer) =>
"sha-256="
+ hasher
+ createHash("sha256")
.update((Buffer.isBuffer(payload) ? payload : Buffer.from(payload)).toString("hex"))
.digest("base64");