diff --git a/src/utils/token.ts b/src/utils/token.ts index b0afdd8f320d1119c3d83c6c8d887e102bff0250..14e892deab16c4d59993796472260c1a7b3f1e31 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: {