fix(security): harden channel token and id generation

This commit is contained in:
Peter Steinberger
2026-02-22 10:09:55 +01:00
parent c3e13175d2
commit ae8d4a8eec
9 changed files with 81 additions and 14 deletions

View File

@@ -0,0 +1,9 @@
import { randomBytes, randomUUID } from "node:crypto";
export function generateSecureUuid(): string {
return randomUUID();
}
export function generateSecureToken(bytes = 16): string {
return randomBytes(bytes).toString("base64url");
}