This commit is contained in:
yml
2026-04-08 16:30:42 +08:00
commit 313c036845
131 changed files with 22393 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
import crypto from 'node:crypto'
export function randomToken(bytes = 24) {
return crypto.randomBytes(bytes).toString('hex')
}
export function randomId(prefix, bytes = 6) {
return `${prefix}${crypto.randomBytes(bytes).toString('hex')}`
}