File size: 319 Bytes
9a42933
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import { customAlphabet } from "nanoid"
  
const nanoid = customAlphabet([
  '1234567890',
  'abcdefghijklmnopqrstuvwxyz',
  'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
].join(''), 10)

export function getRandomPartyId() {
  const num = Math.round(Math.random() * 99)
  const newId = `${nanoid(2)}${num}${nanoid(2)}`
  return newId
}