init
This commit is contained in:
@@ -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')}`
|
||||
}
|
||||
Reference in New Issue
Block a user