mirror of
https://github.com/strapi/strapi.git
synced 2025-07-21 07:57:45 +00:00
14 lines
308 B
JavaScript
14 lines
308 B
JavaScript
![]() |
'use strict';
|
||
|
|
||
|
// Using timestamp (milliseconds) to be sure it is unique
|
||
|
// + converting timestamp to base 36 for better readibility
|
||
|
const generateTimestampCode = date => {
|
||
|
const referDate = date || new Date();
|
||
|
|
||
|
return referDate.getTime().toString(36);
|
||
|
};
|
||
|
|
||
|
module.exports = {
|
||
|
generateTimestampCode,
|
||
|
};
|