KI-AGENT: Zentralen Push-Server Stack ergänzen
This commit is contained in:
13
push-server/apps/api/src/lib/ids.ts
Normal file
13
push-server/apps/api/src/lib/ids.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { randomBytes } from "node:crypto";
|
||||
|
||||
export function createPublicId(prefix: string): string {
|
||||
return `${prefix}_${randomBytes(16).toString("base64url")}`;
|
||||
}
|
||||
|
||||
export function createClientSecret(): string {
|
||||
return `fps_${randomBytes(32).toString("base64url")}`;
|
||||
}
|
||||
|
||||
export function previewSecret(secret: string): string {
|
||||
return `${secret.slice(0, 7)}...${secret.slice(-6)}`;
|
||||
}
|
||||
Reference in New Issue
Block a user