mirror of
https://github.com/strapi/strapi.git
synced 2025-07-23 09:00:19 +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,
|
|
};
|