mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 06:21:26 +00:00
fix(security): harden channel token and id generation
This commit is contained in:
9
src/infra/secure-random.ts
Normal file
9
src/infra/secure-random.ts
Normal 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");
|
||||
}
|
||||
Reference in New Issue
Block a user