fix lodash random call

This commit is contained in:
poros 2025-01-21 19:18:56 +01:00
parent 61eee6eaa1
commit 921f6ef12c

View file

@ -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}`;
}