mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-07-07 13:16:27 -04:00
fix lodash random call
This commit is contained in:
parent
61eee6eaa1
commit
921f6ef12c
1 changed files with 2 additions and 2 deletions
|
@ -14,11 +14,11 @@ export function objectIdFromDate(milliseconds: number, onlyDate: boolean = false
|
||||||
return '0';
|
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 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}`;
|
return `${timestamp}${suffix}`;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue