Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Commit

Permalink
intrn(back-end): make helper to digest
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethTrecy committed Oct 14, 2022
1 parent b7c96ae commit 128d1c2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions common_back-end/helpers/digest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export default async function(source: Buffer): Promise<string> {
const { createHash } = await import("node:crypto")

const hash = createHash("sha256")

hash.update(source)

return hash.digest("hex")
}

0 comments on commit 128d1c2

Please sign in to comment.