UNPKG

@geniucode/common-utils

Version:

Common utils

12 lines 410 B
import { generateKey } from 'fast-key-generator'; export const generateRandomKey = (size = 10, prefix = '') => { const date = Date.now().toString(); const last3Digits = date.slice(date.length - 4, date.length - 1); const randomKey = generateKey({ size, prefix, chartype: 'numeric', }); return `${randomKey}${last3Digits}`; }; //# sourceMappingURL=generate-key.js.map