From c66a1d77497fda1bf5f8231553cd348ab086536e Mon Sep 17 00:00:00 2001
From: Noel Simbolon <84700640+noelsimbolon@users.noreply.github.com>
Date: Mon, 13 Nov 2023 09:40:43 +0700
Subject: [PATCH] fix: wrong hash encoding

---
 src/utils/token.ts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/utils/token.ts b/src/utils/token.ts
index b0afdd8..14e892d 100644
--- a/src/utils/token.ts
+++ b/src/utils/token.ts
@@ -4,13 +4,13 @@ import * as crypto from "crypto";
 
 const generateFingerprint = async (numberOfBytes: number): Promise<string> => {
   const randomBytes: Buffer = crypto.randomBytes(numberOfBytes);
-  return randomBytes.toString("utf8");
+  return randomBytes.toString("hex");
 };
 
 const hashFingerprint = async (fgp: string): Promise<string> => {
   const hash: crypto.Hash = crypto.createHash("sha256");
   hash.update(fgp, "utf8");
-  return hash.digest().toString("utf8");
+  return hash.digest("hex");
 };
 
 const generateAccessTokenAndFingerprint = async (data: {
-- 
GitLab