normal.ts 256 B

123456789
  1. export const randomId = (e = 6): string => {
  2. const t = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678'
  3. const a = t.length
  4. let n = ''
  5. for (let i = 0; i < e; i++) {
  6. n += t.charAt(Math.floor(Math.random() * a))
  7. }
  8. return n
  9. }