Initial 智念AIGC platform
This commit is contained in:
5
lib/server/ids.ts
Normal file
5
lib/server/ids.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { randomBytes } from "node:crypto";
|
||||
|
||||
export function createId(prefix: string): string {
|
||||
return `${prefix}_${Date.now().toString(36)}_${randomBytes(5).toString("hex")}`;
|
||||
}
|
||||
Reference in New Issue
Block a user