This file ( 785B ) exceeds the allowed full mode (48 kb) size.
The editor full hight is disabled, only scrolling is allowed..
If you wish to edit a file, it is recommended to use the scroll mode as some users do not like the full height
mode, although some users like it.
let currentId = 0
let currentIdTime = Date.now()
const random = () => {
return (Math.floor(Math.random() * (99999999999999999 - 10000000000000000)) + 10000000000000000).toString(16)
}
const reverse = function (str) {
return str.split('').reverse().join('')
}
const nextId = () => {
const now = Date.now();
if (currentIdTime !== now) {
currentId = 0;
currentIdTime = now
}
const comingId = ++currentId;
const randomHex = reverse(random()).padStart(15, '0');
const timeHex = reverse(currentIdTime.toString(16).padStart(12, '0'))
const comingIdHex = reverse(comingId.toString(16).padStart(3, '0'));
const newId = `P3Xid${timeHex}${comingIdHex}${randomHex}`;
//console.log(newId)
return newId
}
module.exports = nextId