MCPcopy Create free account
hub / github.com/PromtEngineer/localGPT / generateUUID

Function generateUUID

src/lib/api.ts:4–14  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2
3// 🆕 Simple UUID generator for client-side message IDs
4export const generateUUID = () => {
5 if (typeof window !== 'undefined' && window.crypto && window.crypto.randomUUID) {
6 return window.crypto.randomUUID();
7 }
8 // Fallback for older browsers or non-secure contexts
9 return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
10 const r = (Math.random() * 16) | 0;
11 const v = c === 'x' ? r : (r & 0x3) | 0x8;
12 return v.toString(16);
13 });
14};
15
16export interface Step {
17 key: string;

Callers 2

sendMessageFunction · 0.90
createMessageMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected