From 921f6ef12c8704c331a5e68faf5550a646596032 Mon Sep 17 00:00:00 2001 From: poros Date: Tue, 21 Jan 2025 19:18:56 +0100 Subject: [PATCH] fix lodash random call --- src/utils/objectId.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/objectId.ts b/src/utils/objectId.ts index f79878a2..1ada9bfb 100644 --- a/src/utils/objectId.ts +++ b/src/utils/objectId.ts @@ -14,11 +14,11 @@ export function objectIdFromDate(milliseconds: number, onlyDate: boolean = false return '0'; } - return (_.random() * 16 | 0).toString(16); + return (_.random(0, 1, true) * 16 | 0).toString(16); }; const timestamp = (milliseconds / 1000 | 0).toString(16); - const suffix = 'xxxxxxxxxxxxxxxx'.replace(/[x]/g, suffixReplacer).toLowerCase(); + const suffix = 'xxxxxxxxxxxxxxxx'.replace(/x/g, suffixReplacer).toLowerCase(); return `${timestamp}${suffix}`; }