const snowflakeId = (workerId = 1): string => {
  const timestamp = BigInt(Date.now())
  const workerBits = BigInt(workerId) << 12n
  const sequenceBits = BigInt(Math.floor(Math.random() * 4096))
  return String((timestamp << 22n) | workerBits | sequenceBits)
}

export default {
  snowflakeId,
}
