Skip to content

Commit

Permalink
Update secret-sharing-service.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielHougaard committed Sep 30, 2024
1 parent 902e3cd commit a075fa4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/src/services/secret-sharing/secret-sharing-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const secretSharingServiceFactory = ({
// This will be 36 characters long, due to encoding it to base64.
const id = crypto.randomBytes(27).toString("base64url");

const hashedHex = crypto.createHash("sha256").update(id).digest("base64").substring(0, 13);
const hashedHex = crypto.createHash("sha256").update(id).digest("base64url").substring(0, 13);
const hashedPassword = password ? await bcrypt.hash(password, 10) : null;

const newSharedSecret = await secretSharingDAL.create({
Expand Down Expand Up @@ -125,7 +125,7 @@ export const secretSharingServiceFactory = ({
const encryptedSecret = encryptWithRoot(Buffer.from(secretValue));

const id = crypto.randomBytes(27).toString("base64url");
const hashedHex = crypto.createHash("sha256").update(id).digest("hex").substring(0, 13);
const hashedHex = crypto.createHash("sha256").update(id).digest("base64url").substring(0, 13);
const hashedPassword = password ? await bcrypt.hash(password, 10) : null;

const newSharedSecret = await secretSharingDAL.create({
Expand Down

0 comments on commit a075fa4

Please sign in to comment.