lil home page

This commit is contained in:
Chaoscaot
2023-09-24 16:33:14 +02:00
parent 4dca085cec
commit 53443cf383
34 changed files with 439 additions and 43 deletions

14
src/util/util.ts Normal file
View File

@@ -0,0 +1,14 @@
import { randomBytes } from 'crypto'
const usedIds = new Set<string>()
export const getRandomId = () => {
while (true) {
const id = randomBytes(4).toString('hex')
if (!usedIds.has(id)) {
usedIds.add(id)
return id
}
}
}