mirror of
				https://github.com/strapi/strapi.git
				synced 2025-10-30 17:37:26 +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,
 | |
| };
 | 
